This question is locked. New answers and comments are not allowed.
Hi,
I am using the Cordova InAppBrowser plugin in an Icenium project to allow users to "passively" log onto a website. In order to do this, I am launching a child browser and waiting for the browser to hit the url requested by the application rather than a redirection url such as the logon page, then closing the child browser programatically.
Anyway, I am attaching a handler to the "loadstop" event of the browser reference in order to detect each url loaded into the child browser instance. On the Simulator and on Android devices, this works perfectly. However, on an iOS device, we get the following error after any url loads that was the result of an HTTP redirection, and the "loadstop" handler is never called. I have included a bit of sample JS to demonstrate the issue.
Code:
var windowRef = window.open("https://www.gmail.com", "_blank");
windowRef.addEventListener("loadstop", function (event) {
console.log("loadstop called on: " + event.url); //never fires in this case, console shows error below instead
});
Error:
*** WebKit discarded an uncaught exception in the webView:decidePolicyForMIMEType:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[WebView _canShowMIMEType]: unrecognized selector sent to instance 0x1d5dc850
Note that the loadstop event fires just fine on a "normal" page request that is not the result of redirection.
Additional info:
Icenium 1.7
Cordova 2.7
InAppBrowser Plugin
iPhone 4
Thank you for any information you can provide regarding this issue.
Steve
I am using the Cordova InAppBrowser plugin in an Icenium project to allow users to "passively" log onto a website. In order to do this, I am launching a child browser and waiting for the browser to hit the url requested by the application rather than a redirection url such as the logon page, then closing the child browser programatically.
Anyway, I am attaching a handler to the "loadstop" event of the browser reference in order to detect each url loaded into the child browser instance. On the Simulator and on Android devices, this works perfectly. However, on an iOS device, we get the following error after any url loads that was the result of an HTTP redirection, and the "loadstop" handler is never called. I have included a bit of sample JS to demonstrate the issue.
Code:
var windowRef = window.open("https://www.gmail.com", "_blank");
windowRef.addEventListener("loadstop", function (event) {
console.log("loadstop called on: " + event.url); //never fires in this case, console shows error below instead
});
Error:
*** WebKit discarded an uncaught exception in the webView:decidePolicyForMIMEType:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[WebView _canShowMIMEType]: unrecognized selector sent to instance 0x1d5dc850
Note that the loadstop event fires just fine on a "normal" page request that is not the result of redirection.
Additional info:
Icenium 1.7
Cordova 2.7
InAppBrowser Plugin
iPhone 4
Thank you for any information you can provide regarding this issue.
Steve