[ 
https://issues.apache.org/jira/browse/CB-8444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14319060#comment-14319060
 ] 

ASF GitHub Bot commented on CB-8444:
------------------------------------

GitHub user jpchase opened a pull request:

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

    CB-8444 Don't clobber `window.open`

    There are scenarios where an app needs the built-in `window.open` 
functionality (i.e. to open an url in the system browser).  As the InAppBrowser 
clobbers window.open, it requires the app to either change all affected 
`window.open` calls (to add "target=_system"), or undo the clobber.  This 
clobber is particularly problematic when InAppBrowser is added to an app as a 
dependency of another plugin.  For example, a plugin that provides an external 
web-based authentication flow.
    
    Instead, each app should be able to control whether `window.open` is 
clobbered, regardless of the inclusion of the InAppBrowser plugin.  This PR is 
a first step to add a new API to access the InAppBrowser, separately from 
`window.open`.  The intention is to then remove the clobber of `window.open` in 
a future release.
    
    Changes:
    - Add new symbol/clobber to access open function 
(`cordova.InAppBrowser.open`)
    - Change existing tests to use new symbol (i.e. don't rely on plugin 
clobber of `window.open`)
    - Add tests to use `window.open` via manual replace with new symbol
    - Update docs to deprecate plugin clobber of `window.open`

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jpchase/cordova-plugin-inappbrowser CB-8444

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-inappbrowser/pull/80.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #80
    
----
commit ad263a1b539660b00e4cd4d4c5ac7be38acf9351
Author: Jason Chase <jasonpch...@gmail.com>
Date:   2015-02-12T21:34:32Z

    CB-8444 Don't clobber `window.open`
    - Add new symbol/clobber to access open function 
(`cordova.InAppBrowser.open`)
    - Change existing tests to use new symbol (i.e. don't rely on plugin 
clobber of `window.open`)
    - Add tests to use `window.open` via manual replace with new symbol
    - Update docs to deprecate plugin clobber of `window.open`

----


> Don't clobber `window.open`
> ---------------------------
>
>                 Key: CB-8444
>                 URL: https://issues.apache.org/jira/browse/CB-8444
>             Project: Apache Cordova
>          Issue Type: Wish
>          Components: Plugin InAppBrowser
>            Reporter: sandstrom
>            Assignee: Jason Chase
>
> Where Cordova plugins map 1:1 to W3C API's it's great that they clobber the 
> corresponding namespace. Geolocation is a good example.
> However, it doesn't really feel like this plugin is a 1:1, so perhaps it 
> should be available at another name, e.g. `window.iabOpen` (the old API 
> should be preserved until the next major though, since to keep backward 
> compatibility).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to