Hello everybody .
I'm trying to create an app that contains a web page using a <webview> .
The basic I got. My app is opening the page, but the links that open popups do not work .
I've read about the Event Listener " newwindow " . I do not know how to apply in my code .
In my html page I placed the following : <script src="controls.js"> < / script >
And controls.js file put the code :
onload = function() {
var webview = document.getElementById("SISTEMA");
var indicator = document.querySelector(".indicator");
var loadstart = function() {
indicator.innerText = "carregando...";
}
var loadstop = function() {
indicator.innerText = "";
}
webview.addEventListener("loadstart", loadstart);
webview.addEventListener("loadstop", loadstop);
webview.addEventListener('newwindow', function(e) {
var newWebview = document.createElement('webview');
document.body.appendChild(newWebview);
e.window.attach(newWebview); });
}
Where am I going wrong ?
Attached is my project . Many thanks for the help .