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

Jon Whitlock updated CB-4603:
-----------------------------

    Description: 
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;
{code:title=InAppBrowser.java|borderStyle=solid}
    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*/
{code}

  was:
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;
{code:title=Bar.java|borderStyle=solid}
    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*/
{code}

    
> 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;
> {code:title=InAppBrowser.java|borderStyle=solid}
>     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*/
> {code}

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

Reply via email to