Ignore error when attempting to remove IAB event listeners
This commit is contained in:
parent
f2b013bee2
commit
8dca406184
@ -184,11 +184,17 @@ function initCordova() {
|
|||||||
}
|
}
|
||||||
cordovaInAppBrowserRef = cordova.InAppBrowser.open(url, "_blank", options);
|
cordovaInAppBrowserRef = cordova.InAppBrowser.open(url, "_blank", options);
|
||||||
if (typeof onclose == "function") {
|
if (typeof onclose == "function") {
|
||||||
cordovaInAppBrowserRef.removeEventListener("exit");
|
try {
|
||||||
|
cordovaInAppBrowserRef.removeEventListener("exit");
|
||||||
|
} catch (ex) {
|
||||||
|
}
|
||||||
cordovaInAppBrowserRef.addEventListener("exit", onclose);
|
cordovaInAppBrowserRef.addEventListener("exit", onclose);
|
||||||
}
|
}
|
||||||
if (typeof onmessage == "function") {
|
if (typeof onmessage == "function") {
|
||||||
cordovaInAppBrowserRef.removeEventListener("message");
|
try {
|
||||||
|
cordovaInAppBrowserRef.removeEventListener("message");
|
||||||
|
} catch (ex) {
|
||||||
|
}
|
||||||
cordovaInAppBrowserRef.addEventListener("message", onmessage);
|
cordovaInAppBrowserRef.addEventListener("message", onmessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user