cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <>
Subject Re: CB-8444: Proposal to deprecate the clobber of by InAppBrowser
Date Fri, 13 Feb 2015 15:17:54 GMT
Totally makes sense that when IAB is used as a dependency we wouldn't want to be changed. Possibly we could add logic to do different
things when a plugin is a dependency vs. required explicitly, but I think
that might overcomplicate things.

I think it makes sense to keep require() for use by plugins, and to expose
a proper API for use by apps.

Preference might make sense, but I don't think there's an easy way to
access the value of the preference from JS, so it's probably more work than
it's worth since it's a one-liner in JS to switch the behaviour:

delete // Reverts the call back to it's prototype's default = // Enable IAB by default

Might be a good idea to document the first example in the README until we
no longer clobber by default.

On Fri, Feb 13, 2015 at 8:14 AM, Michal Mocny <> wrote:

> Open question: do we even need to clobber a symbol, or would
> cordova.require('org.apache.cordova.iab').open() suffice?
> Could we leave compatibility by default, but support opting-in to the
> switch now?  Perhaps a <runs/> flag in the plugin and clobber
> from javascript only if a <preference name="IABShouldNotClobberWindowOpen">
> is not set, instead of using unconditional <clobbers/> from plugin.xml?
> That may have a slight implication about when the clobber happens during
> startup, but is unlikely to be an issue in practice.
> -Michal
> On Thu, Feb 12, 2015 at 5:19 PM, Jason Chase <> wrote:
> > For CB-8444, I'm proposing to eventually remove the clobber of
> > '' that is done by the InAppBrowser plugin.
> >
> > The problem I'm trying to solve is unintended changes to the behaviour of
> > 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  As a result, 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
> >  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
> >  If an app wishes all 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
> >
> > I'd welcome any comments on this proposal.  This includes any example use
> > cases that want the clobber of by the plugin.
> >
> > Thanks,
> > Jason
> > Google Cordova Team
> >
> > [1]
> >

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message