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

Shazron Abdullah commented on CB-362:
-------------------------------------

see also Andrew's blog post regarding current behaviour in Cordova: 
https://build.phonegap.com/blog/access-tags

To be clear, iOS allows everything to happen within a UIWebView, load external 
as well as file urls that are in your app sandbox. On a iOS device, iOS 
restricts your app from loading a file url in Mobile Safari.

Effectively - a file url anchor tag with target doesn't work anyway according 
to iOS' restrictions so this is a documentation issue.

A http url with or without target is within what we can control. With target, 
that's easy, we punt it to Mobile Safari. Without target, the current behaviour 
is to load it into UIWebView, replacing the existing page that the anchor tag 
is in - my fix proposal is we don't do this. 

If an external webpage takes over the UIWebView, how would you get "back" to 
your app? Are there scenarios where people do this or this is desired? Note 
that my proposal will not affect loading http urls in iFrames.

>From my tests, any anchor target value will trigger a new request, with its 
>UIWebViewNavigationType as UIWebViewNavigationTypeOther which Apple defines as 
>"Some other action occurred." in their docs for UIWebView (not really 
>helpful), thus there is no way to differentiate between "_self" or "_blank". 
>We are treating any target value as "_blank" effectively.

Android and Blackberry behaviour is listed in the link I put at the start of 
this comment. Looking at that table in the link, this proposed fix (the only 
fix I can think of to solve this issue) is to correct the "unlisted" behaviour 
of iOS. But, in doing so, it will alter the expectations of the "whitelisted" 
column for iOS.

*With the proposed fix:*
Regular link -- changes from "webview" to "webview (file urls only)"
target="_blank" -- stays the same as "browser" (file urls can't be opened in 
the browser anyway - iOS restriction)

The problem with my proposed fix is it will change expected behaviour across 
all the platforms (ie iOS does it this way, but Android does it that way), thus 
it is high risk and against the project's philosophy, which suggests to me that 
this issue is a "won't fix".


                
> [ios] target="_blank" links should open in browser (ignoring externalhosts)
> ---------------------------------------------------------------------------
>
>                 Key: CB-362
>                 URL: https://issues.apache.org/jira/browse/CB-362
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.5.0
>            Reporter: Andrew Lunny
>            Assignee: Shazron Abdullah
>              Labels: externalhosts, whitelist
>             Fix For: 1.7.0
>
>
> A link such as this:
> {noformat}<a href="http://google.com"; target="_blank">Google</a>{noformat}
> should open by default in the device's web browser, without being explicitly 
> allowed in the plist (externalhosts).
> This is the current (and, imo, expected) behaviour on Android.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to