The webview does not display the javascript alert() dialog

Hello!
The webview does not display the javascript alert() dialog
(Screenshot - work in the browser)
In the application, when you click on the red link, nothing happens, the alert is not displayed.
Are there settings that can be added to display the alert in the webview?
Or how can it be turned on?
Thanksскрин
!

Alert and confirm currently are not supported in webview on iOS. You can detect any events on the web page and process them in Flipabit.

This html page contains buttons for calling alert and confirm.

<html>
<body>

<button onclick="myAlert()">Alert button</button>

<br><br>

<button onclick="myConfirm()">Confirm button</button>

<br><br>

<button id="myBtn" onclick="myButton()">Simple button</button>

<script>
function myAlert() {
  alert("Some alert");
}

function myConfirm() {
  confirm("Are you sure?");
}

function myButton() {
  ;
}
</script>

</body>
</html>

When the page loads, in Flipabit I run on the loaded page the following code to catch events and change the url hash:

(function() {
    window.alert = function() {
        window.location.hash = '#' + arguments[0];
    };
    window.confirm = function() {
        window.location.hash = '#' + arguments[0];
    };
    const element = document.getElementById('myBtn');
    element.addEventListener('click', function() {
       window.location.hash = '#myBtn';
    });
})()

image

When changing the hash, in Flipabit you can call the javascript function or open a page with a different url, etc.

image

Project file alert_detection.pma (6.0 KB)

Thanks for the help!


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.