[
https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16576940#comment-16576940
]
ASF GitHub Bot commented on CB-14234:
-------------------------------------
dpolivy opened a new pull request #278: CB-14234: (ios) Don't call
handleOpenURL for system URLs
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/278
When calling `.open()` with a target of `_system`, the InAppBrowser on iOS
is both launching the URL in the system browser AND also broadcasting to open
the URL within the app (calling handleOpenURL). The latter behavior is
problematic in many circumstances (e.g. when you want to explicitly open a link
in a browser which is a universal link handled by the app).
This commit attempts to address this by checking the return value from
openURL -- if it does not open the URL successfully, then (and only then) the
code falls back to broadcasting the event within the app to handleOpenURL.
<!--
Please make sure the checklist boxes are all checked before submitting the
PR. The checklist
is intended as a quick reference, for complete details please see our
Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
iOS
### What does this PR do?
Fixes CB-14234; it checks the return value of the call to `openURL`, and
only broadcasts the `handleOpenURL` event within the app if `openURL` fails to
open the URL in the system.
### What testing has been done on this change?
I've done manual testing on iOS
### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html)
in the JIRA database
- [ x] Commit message follows the format: "CB-3232: (android) Fix bug with
resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform
affected.
- [ ] Added automated test coverage as appropriate for this change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> InAppBrowser iOS calls handleOpenURL in same app for _system URLs
> -----------------------------------------------------------------
>
> Key: CB-14234
> URL: https://issues.apache.org/jira/browse/CB-14234
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-plugin-inappbrowser
> Affects Versions: 3.0.0
> Reporter: Dan Polivy
> Priority: Minor
>
> The change to fix CB-11178 has caused some undesirable behavior with
> InAppBrowser on iOS. Now, whenever you try to open a URL in the system
> browser, by calling `cordova.InAppBrowser.open(url, "_system")`, it opens the
> system browser AND calls `handleOpenURL` _in your app_ with the same URL.
> In my case, my app is a URL handler for a corresponding web domain (app
> links). I am trying to open a page on this web domain in the system browser
> from within my app. If my app's handleOpenURL is called with a URL also on
> the domain, then my handler thinks it is handling an app link and it causes
> the app to navigate to another URL, which in this case is not desired or
> expected.
> Prior to the fix for CB-11178, this worked perfectly. Is there any other way
> to address the fix for CB-11178 without inheriting this incorrect and
> undesirable behavior?
> [~jcesarmobile]: FYI as you committed the fix in question.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]