Skip to content

cli: do not double quote chromeFlags#3775

Merged
brendankenny merged 2 commits intomasterfrom
do_not_wrap_chrome_flags
Nov 10, 2017
Merged

cli: do not double quote chromeFlags#3775
brendankenny merged 2 commits intomasterfrom
do_not_wrap_chrome_flags

Conversation

@patrickhulce
Copy link
Collaborator

closes #3744

Copy link
Contributor

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dd27317#r140888688

:)

So basically it's taken care of since spawn passes in arguments as an array, so they don't need their values quoted? Or something else? This is confusing because the fix in #2754 needed quotes, but maybe the spawn method or our handling of chromeFlags has changed since then.

I tried out the problem case from that PR (--chrome-flags="--user-agent=\"iPhone Test\"") and it works just fine with this PR.

👍 for the explanatory comment, but maybe the tests can do with some cleaning up? Some repetition now and not all the descriptions match up to their test (e.g. quotes flag values with spaces in them)

@patrickhulce
Copy link
Collaborator Author

Link just takes me to the commit so not entirely sure if you're talking about #3408 (comment), but the short story here is that quoting any value is indeed bad, not that quoting single words is bad but spaced values is fine.

So basically it's taken care of since spawn passes in arguments as an array, so they don't need their values quoted?

Correct

This is confusing because the fix in #2754 needed quotes, but maybe the spawn method or our handling of chromeFlags has changed since then.

Nothing has changed, but it is confusing. #2754 was about us needing to respect quoted values when parsing because we just did a basic s.split(' '). This issue is about us needing to not add superfluous quotes when sending along the parsed values.

All of this would go away if we weren't using spawn and just doing a shell chrome ${theRawFlags}, but because we parse and pass as array it raises all these problems

maybe the tests can do with some cleaning up?

ya done

Copy link
Contributor

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brendankenny
Copy link
Contributor

appveyor is being dumb missing that offscreen svg again. Ignoring for now

@brendankenny brendankenny merged commit fffc8f3 into master Nov 10, 2017
@brendankenny brendankenny deleted the do_not_wrap_chrome_flags branch November 10, 2017 20:18
@hirokith
Copy link

When could this merge be published? I've encountered the --user-data-dir wrapped with quotes, which breaks my program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overriding user agent using --chrome-flags adds additional quotes to user agent

4 participants