You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jon Whitlock (JIRA)" <ji...@apache.org> on 2013/08/16 16:00:48 UTC

[jira] [Created] (CB-4603) InAppBrowser parseFeature doesn't strip whitespace from supplied options

Jon Whitlock created CB-4603:
--------------------------------

             Summary: InAppBrowser parseFeature doesn't strip whitespace from supplied options
                 Key: CB-4603
                 URL: https://issues.apache.org/jira/browse/CB-4603
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android, Plugin InAppBrowser
    Affects Versions: 3.0.0
         Environment: Android
            Reporter: Jon Whitlock
            Assignee: Joe Bowser
            Priority: Minor


Short story:
window.open('/', '_blank', 'location=no,hidden=yes');
... works, 
window.open('/', '_blank', 'location=no, hidden=yes');
... doesn't.

parseFeature does
 StringTokenizer features = new StringTokenizer(optString, ",");
... where optString is that third parameter. Then in the case of deciding if a window should be hidden on launch, in showWebPage tries;

            Boolean hidden = features.get(HIDDEN);
where
    private static final String HIDDEN = "hidden";

"hidden" != " hidden" ;)

'location = no,hidden = yes' etc also breaks it.

It's a one-line fix, around line 248 in InAppBrowser.java;

    private HashMap<String, Boolean> parseFeature(String optString) {
        if (optString.equals(NULL)) {
            return null;
        } else {
            HashMap<String, Boolean> map = new HashMap<String, Boolean>();
            optString = optString.replaceAll("\\s",""); /* this line fixes it*/


--
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