-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escaped double-quotes in addArguments don't get de-escaped #194
Comments
This might be WAI? I think there's no shell involved here, so each item in the array is just passed through directly to the process as its own argv item. So for example, if you want to pass an argument with spaces in it, there should be no quoting required. This is actually handled by the webdriver library (not to say that means it's correct, just FYI this is how using webdriver directly would work too). Is there something you can't achieve with the current behavior, or is it more that it's confusing that you can't always copy/paste to/from a commandline shell? |
Thanks! The problem is that it seems impossible to pass arguments that contain a chrome --blink-settings="forceDarkModeEnabled=true" ...I don't seem to be able to do that. I can't use a naked chrome --blink-settings=\"forceDarkModeEnabled=true\" If I wanted to pass that as the actual command line, I would have expected to need to double-escape it, like this, in the JSON: "addArguments": ["--blink-settings=\\\"forceDarkModeEnabled=true\\\""], Note that most command line arguments don't need quotes, because the stuff inside the quotes contains no spaces. But some documentation (e.g. here) shows command line parameters with the quotes, and when escaped, they are silently ignored. I believe those can be replaced with single quotes (e.g. Perhaps there should just be a warning or something? Feel free to disregard this bug, it is clearly low priority. |
It appears that double-quotes in the command line aren't being properly de-escaped when passed to the chrome process. See the example below. Using escaped double quote (\") seems to pass exactly that (\") to the chrome process, rather than just the raw double-quote ("). I've tried swapping to single quotes (') for the outer set around the arguments, but that is a syntax error.
The text was updated successfully, but these errors were encountered: