cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jcesarmobile (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-8518) InAppBrowser fails to open external urls in system browser (naive fix included)
Date Thu, 02 Apr 2015 21:16:35 GMT

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

jcesarmobile edited comment on CB-8518 at 4/2/15 9:14 PM:
----------------------------------------------------------

I'm checking it and I can't reproduce the bug on the latest version of the inAppBrowser plugin
(0.6.0).
Can you check if it to confirm that you still see this?


was (Author: jcesarmobile):
I'm checking it and I can't reproduce the bug on the latest version of the inAppBrowser plugin.
Can you check if it to confirm that you still see this?

> InAppBrowser fails to open external urls in system browser (naive fix included)
> -------------------------------------------------------------------------------
>
>                 Key: CB-8518
>                 URL: https://issues.apache.org/jira/browse/CB-8518
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin InAppBrowser
>    Affects Versions: 0.6.1
>         Environment: ios 8.1, tested in ipad air emulator
>            Reporter: Achim Staebler
>            Assignee: jcesarmobile
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Attempts to open an external url with
> window.open("http://www.apache.org", "_system");
> fail silently. The root cause is line 91, where an absolute URL is constructed from the
app's base URL and the url passed to window.open:
>         NSURL* absoluteUrl = [[NSURL URLWithString:url relativeToURL:baseUrl] absoluteURL];
>  However, cordova resources are served via file:// scheme, so absoluteURL will be nil
in this case. My suggested fix compares the URL's schemes and skips creating a relative url
when this clearly does not work:
> NSURL* absoluteUrl;
>         NSURL* urlTarget = [NSURL URLWithString:url];
>         if ([urlTarget.scheme isEqualToString:baseUrl.scheme]) {
>             // same protocol, can use relative URL Relative to base
>             absoluteUrl = [[NSURL URLWithString:url relativeToURL:baseUrl] absoluteURL];
>         } else {
>             absoluteUrl = urlTarget;
>         }
> I'm not submitting this as a pull request because I'm not certain about the portential
security implications this native fix might have.



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

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


Mime
View raw message