window.open addEventListener does not work on "Mobile Browser Simulator"

283 views Asked by At

I'm using IBM Worklight 6.2

I'm using window.open to load some external pages for OAuth and I configure event listeners for the opened window.

var authWindow = window.open(authUrl, '_blank', 'location=yes');

authWindow.addEventListener('loaderror', function(e) {  
    console.log(">> load error. event: " + JSON.stringify(e));
});

also for "load" and "loadstart" events.

This works in Android and iOS but when I preview the app in the "Mobile Browser Simulator" the eventListeners are not executed.

I have also tested creating a "desktopbrowser" application.

Any idea?

1

There are 1 answers

2
nspeete On BEST ANSWER

Loaderror, loadstart, and loadstop are specific to Cordova and not supported in the Mobile Browser Simulator. It would be best to test these on emulator or device. Please see: http://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html#addEventListener