[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16589379#comment-16589379 ] ASF GitHub Bot commented on CB-14234: - jcesarmobile commented on issue #278: CB-14234: (ios) Don't call handleOpenURL for system URLs URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/278#issuecomment-415191243 Yeah, sometimes comments are good, but for so small change and being the issue and the PR linked to the commit, it's really easy to see why this was done, so no need of extra comments. Thanks for the PR! 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: us...@infra.apache.org > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16589378#comment-16589378 ] ASF subversion and git services commented on CB-14234: -- Commit cf58b04097ad53151f4c456d0fef27dd5cecd966 in cordova-plugin-inappbrowser's branch refs/heads/master from [~dpolivy] [ https://gitbox.apache.org/repos/asf?p=cordova-plugin-inappbrowser.git;h=cf58b04 ] CB-14234: Don't call handleOpenURL for system URLs (#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. > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16589377#comment-16589377 ] ASF GitHub Bot commented on CB-14234: - jcesarmobile closed pull request #278: CB-14234: (ios) Don't call handleOpenURL for system URLs URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/278 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/src/ios/CDVInAppBrowser.m b/src/ios/CDVInAppBrowser.m index 5bdb3e1eb..b0acc7a1d 100644 --- a/src/ios/CDVInAppBrowser.m +++ b/src/ios/CDVInAppBrowser.m @@ -298,8 +298,9 @@ - (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options - (void)openInSystem:(NSURL*)url { -[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; -[[UIApplication sharedApplication] openURL:url]; +if ([[UIApplication sharedApplication] openURL:url] == NO) { +[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; +} } // This is a helper method for the inject{Script|Style}{Code|File} API calls, which 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: us...@infra.apache.org > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16589310#comment-16589310 ] ASF GitHub Bot commented on CB-14234: - dpolivy commented on issue #278: CB-14234: (ios) Don't call handleOpenURL for system URLs URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/278#issuecomment-415162493 @jcesarmobile First time I've been asked to _remove_ comments from code Done, and commit/PR updated. Let me know if there's anything else needed to merge this. 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: us...@infra.apache.org > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16588061#comment-16588061 ] ASF GitHub Bot commented on CB-14234: - jcesarmobile commented on issue #278: CB-14234: (ios) Don't call handleOpenURL for system URLs URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/278#issuecomment-414835280 Looks good to me, but remove the comment, if somebody want to know why it's changed they can check the git log/blame and the commit already have the issue id, so it's easy to spot 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: us...@infra.apache.org > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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. ### 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- 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: us...@infra.apache.org > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16573442#comment-16573442 ] Dan Polivy commented on CB-14234: - [~jcesarmobile]: I'm looking into this, and was wondering if the logic could be simplified to use the return value from openURL to determine whether to post the notification within the app. openURL returns a BOOL indicating whether the URL was successfully opened ([https://developer.apple.com/documentation/uikit/uiapplication/1622961-openurl?language=objc)] – would a better fix be to check the return value from that, and if it is NO _then_ we post the notification within the app? I am still curious as to the reason why the notification would be posted to the app at all. I don't see a scenario when you explicitly try to open a URL in the system browser where it would be expected to open in the app instead. That code appears to have been in there from the beginning, though, so I don't know the context/history under which it was added, and whether removing it would break any existing use case. cc:[~hermwong] who made the initial commit, in case he has insight to share. I'm happy to submit a PR but would appreciate some input first. > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16563833#comment-16563833 ] Dan Polivy commented on CB-14234: - [~jcesarmobile]: I can't differentiate the URL in handleOpenURL, because it *could* be a legitimate URL the app can handle, but in *this case* I want it to open in the system browser, not the app. It's weird to me that the syntax of window.open(url, "_system") would even attempt to open in the app – by specifying the target as "_system" that's a pretty explicit statement you want it to open in the system browser. For my purposes, not sending handleOpenURL for http/https should address this, as we do check the incoming URL to validate it before handling it. Other schemes (aside from our custom scheme which launches the app) should be ignored. I'm curious, though, under what scenario is it expected to call handleOpenURL on the app when trying to open a URL (http/https or otherwise) in the system? > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16563523#comment-16563523 ] jcesarmobile commented on CB-14234: --- Sorry, but Critical for you doesn't mean Critical for the project. You can probably check on handleOpenURL if the url is internal or not. The plugin can probably be changed to only send the handleOpenURL event when it's not http or https url, would that help to your project? > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-14234) InAppBrowser iOS calls handleOpenURL in same app for _system URLs
[ https://issues.apache.org/jira/browse/CB-14234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16562652#comment-16562652 ] Dan Polivy commented on CB-14234: - Linking the issue that is causing this incorrect/undesirable behavior. > 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: Critical > > 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: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org