From 074d4d03eaccb9210f21f600aed837b2049016d8 Mon Sep 17 00:00:00 2001 From: Niklas Merz Date: Tue, 14 Apr 2020 15:25:54 +0200 Subject: [PATCH] (all platforms): remove "window.open" overwrite (#600) Closes #599 --- README.md | 20 ++++---------------- plugin.xml | 5 ----- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 72de923..4df9607 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,10 @@ InAppBrowser window, by replacing window.open: window.open = cordova.InAppBrowser.open; +If you change the browsers `window.open` function this way, it can have unintended side +effects (especially if this plugin is included only as a dependency of another +plugin). + The InAppBrowser window behaves like a standard web browser, and can't access Cordova APIs. For this reason, the InAppBrowser is recommended if you need to load third-party (untrusted) content, instead of loading that @@ -52,22 +56,6 @@ whitelist, nor is opening links in the system browser. The InAppBrowser provides by default its own GUI controls for the user (back, forward, done). -For backwards compatibility, this plugin also hooks `window.open`. -However, the plugin-installed hook of `window.open` can have unintended side -effects (especially if this plugin is included only as a dependency of another -plugin). The hook of `window.open` will be removed in a future major release. -Until the hook is removed from the plugin, apps can manually restore the default -behaviour: - - delete window.open // Reverts the call back to its prototype's default - -Although `window.open` is in the global scope, InAppBrowser is not available until after the `deviceready` event. - - document.addEventListener("deviceready", onDeviceReady, false); - function onDeviceReady() { - console.log("window.open works well"); - } - ## Installation cordova plugin add cordova-plugin-inappbrowser diff --git a/plugin.xml b/plugin.xml index 8cf6068..6a89657 100644 --- a/plugin.xml +++ b/plugin.xml @@ -37,7 +37,6 @@ - @@ -71,7 +70,6 @@ - @@ -95,7 +93,6 @@ - @@ -111,7 +108,6 @@ - @@ -123,7 +119,6 @@ -