i have been developing mobile app android/ios/windows 8 in cordova needs pass few strings web page. unfortunately me, web page not support tls 1.0 protocol, means older android versions (and ios versions) cannot open page within native browser.
this means window.open call, when set '_blank', not load page on android version before 16 api, , it's guaranteed 19 api , above:
window.open('https://www.libertymountain.com/login.aspx','_blank') my solution change "_system" instead of "_blank". works, because phone can use chrome or safari browser instead of native browser. however, when this, of callbacks cease work. opens page, , can't run script on it.
for example, code below not ever execute callback. merely opens webpage:
var ref = window.open('https://www.libertymountain.com/login.aspx','_system'); ref.addeventlistener('loadstart', function() { alert("hello"); }); am missing something, or there proper way this?
edit: make clear, code never triggers callback:
document.addeventlistener("deviceready", init, false); function init() { window.open = cordova.inappbrowser.open; var ref = window.open('https://www.libertymountain.com/login.aspx', '_system'); // event never triggers, nor other event, though // webpage opened in chrome websitereference.addeventlistener('loadstart', function(event) { console.log('hello'); }); } if change this, events trigger. need '_system' otherwise older android , ios devices won't able it.
document.addeventlistener("deviceready", init, false); function init() { window.open = cordova.inappbrowser.open; // change '_system' '_blank' var ref = window.open('https://www.libertymountain.com/login.aspx', '_blank'); // event never triggers, nor other event, though // webpage opened in chrome websitereference.addeventlistener('loadstart', function(event) { console.log('hello'); }); }
i heard can't execute scripts or trigger callbacks in external system browsers (when using '_system' option inappbrowser window.open()). testing, seems true. on other hand, '_blank' of course trigger callbacks because using native browser within app.
Comments
Post a Comment