For CB-8444, I'm proposing to eventually remove the clobber of
'window.open' that is done by the InAppBrowser plugin.

The problem I'm trying to solve is unintended changes to the behaviour of
window.open calls in an app.  An example of untended change is an app that
adds a plugin which provides an external web-based authentication flow.
The plugin has a dependency on InAppBrowser, in order to provide the
web-based login.  The app developer would likely be unaware that the
InAppBrowser plugin clobbers window.open.  As a result, window.open calls
that would open the system browser, will show the pages in the InAppBrowser
instead.

The first step is to add a new API to access the InAppBrowser, instead of
window.open.  The behaviour of the plugin is unchanged, it's just accessed
via a different symbol.  This is covered by the referenced pull request [1].

In a future major release, the second step is to remove the clobber of
window.open.  If an app wishes all window.open calls to be handled by the
InAppBrowser, the app can explicitly implement the clobber.  Conversely,
other apps are no longer forced to work around the clobber of window.open.

I'd welcome any comments on this proposal.  This includes any example use
cases that want the clobber of window.open by the plugin.

Thanks,
Jason
Google Cordova Team

[1] https://github.com/apache/cordova-plugin-inappbrowser/pull/80

Reply via email to