Ignore error when attempting to remove IAB event listeners

master
Skylar Ittner 3 years ago
parent f2b013bee2
commit 8dca406184

@ -184,11 +184,17 @@ function initCordova() {
}
cordovaInAppBrowserRef = cordova.InAppBrowser.open(url, "_blank", options);
if (typeof onclose == "function") {
cordovaInAppBrowserRef.removeEventListener("exit");
try {
cordovaInAppBrowserRef.removeEventListener("exit");
} catch (ex) {
}
cordovaInAppBrowserRef.addEventListener("exit", onclose);
}
if (typeof onmessage == "function") {
cordovaInAppBrowserRef.removeEventListener("message");
try {
cordovaInAppBrowserRef.removeEventListener("message");
} catch (ex) {
}
cordovaInAppBrowserRef.addEventListener("message", onmessage);
}
}

Loading…
Cancel
Save