platform.ready().then(() => {
let url = 'https://google.com/'
let browser = new InAppBrowser(url, '_self');
browser.on('loadstop').subscribe((event) =>{
console.log("loadstop");
console.log(event.url);
})
});
Firstly, I figured out with a lot of trouble that the github doc for cordova’s inappbrowser doesn’t apply to Ionic’s implementation of it; the Cordova plugin should allow:
browser.addEventListener('', function(){})
But instead within Ionic 2 it seems we need to do:
browser.on('event').subscribe(function(e){...})
Yet, my event never fires. I’m browsing all around the place, and my browser never logs the URL to my console.
let option = "location=no,hidden=yes";
let url = "http://www.muoversi.regione.lombardia.it/planner/jsp/mobile/index.html"
let browser = new InAppBrowser(url, '_blank', option);
browser.on('loadstop').subscribe(function(event) {
console.log("subscribed");
browser.show();
});