gildas-lormeau / single-file-cli

CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)
GNU Affero General Public License v3.0
539 stars 57 forks source link

User agents with () break #88

Open masylum opened 1 month ago

masylum commented 1 month ago

Due to how the args are parsed and sent to chromium, options can't contain parenthesis.

Repro case:

single-file https://google.com --user-agent="Mozilla/5.0 () Firefox"

but this does not fail:

single-file https://google.com --user-agent="Mozilla/5.0 Firefox"

While debugging, if I evaluate this.options.args in deno-polyfill, we are sending this to chromium:

'--user-agent=Mozilla/5.0 () Firefox'
gildas-lormeau commented 1 month ago

How would you describe the problem on your side? On my machine (macOS), the command single-file https://example.com --user-agent="Mozilla/5.0 () Firefox" --browser-debug works as expected and I can see in the debugger that the user-agent value is correct in the HTTP headers, see the screenshot below.

image