You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Timo Ernst (JIRA)" <ji...@apache.org> on 2013/02/20 15:41:12 UTC

[jira] [Updated] (CB-2498) PhoneGap InAppBrowser: Cannot open link with “%” character

     [ https://issues.apache.org/jira/browse/CB-2498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Ernst updated CB-2498:
---------------------------

    Description: 
I am using PhoneGap 2.4 for my iOS project.

When opening external URL's in a new webview layer via JS call window.open(url, "_blank");, this works well for "simple" URL's, e.g. "http://www.google.com".

BUT

more complicated URL's which include whitespaces and special characters are a problem. To avoid this, I URL-encode them via this JavaScript-call:

url = encodeURIComponent(url);
This won't work with the InAppBrowser plugin. Instead I get an error message saying:

webView:didFailLoadWithError - The operation couldn't be completed. (WebKitErrorDomain error 101.)

So, I looked into this and I noticed that the call to window.open(url, "_blank"); fails with this error message if the url contains the "%" character, e.g. if a whitespace character gets encoded to "%20".

How can I work around this? Isn't this a bug?

Update: I just tested the same app on Android with PhoneGap 2.3. Works like a charm. So it's either an iOS issue or a problem with the latest PhoneGap release which is 2.4.

  was:See http://stackoverflow.com/questions/14935493/phonegap-inappbrowser-cannot-open-link-with-character/14967348#14967348

    
> PhoneGap InAppBrowser: Cannot open link with “%” character
> ----------------------------------------------------------
>
>                 Key: CB-2498
>                 URL: https://issues.apache.org/jira/browse/CB-2498
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>         Environment: iOS
>            Reporter: Timo Ernst
>            Priority: Critical
>
> I am using PhoneGap 2.4 for my iOS project.
> When opening external URL's in a new webview layer via JS call window.open(url, "_blank");, this works well for "simple" URL's, e.g. "http://www.google.com".
> BUT
> more complicated URL's which include whitespaces and special characters are a problem. To avoid this, I URL-encode them via this JavaScript-call:
> url = encodeURIComponent(url);
> This won't work with the InAppBrowser plugin. Instead I get an error message saying:
> webView:didFailLoadWithError - The operation couldn't be completed. (WebKitErrorDomain error 101.)
> So, I looked into this and I noticed that the call to window.open(url, "_blank"); fails with this error message if the url contains the "%" character, e.g. if a whitespace character gets encoded to "%20".
> How can I work around this? Isn't this a bug?
> Update: I just tested the same app on Android with PhoneGap 2.3. Works like a charm. So it's either an iOS issue or a problem with the latest PhoneGap release which is 2.4.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira