New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680405 link

Starred by 4 users

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Regression



Sign in to add a comment

--user-agent CLI argument ignored when running headless

Reported by lawn...@gmail.com, Jan 12 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

Steps to reproduce the problem:
1. google-chrome-unstable --headless --remote-debugging-port=9222 --disable-gpu --user-agent='foo bar' http://www.whatsmyua.com/

2. Navigate to localhost:9222 and click the link to start debugging remotely
3. Observe user agent displayed by website
4. Evaluate 'navigator.userAgent' in remote debugger console

What is the expected behavior?
The reported user agent should be 'foo bar'

What went wrong?
The user agent is reported as "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36"

Did this work before? N/A 

Chrome version: 57.0.2970.0  Channel: dev
OS Version: Ubuntu 16.04.1 LTS
Flash Version: 

This works as expected without the `--headless` flag
 

Comment 1 by alph@chromium.org, Jan 14 2017

Cc: skyos...@chromium.org alexclarke@chromium.org
Components: -Platform>DevTools

Comment 2 by ajha@chromium.org, Jan 16 2017

Cc: -skyos...@chromium.org ajha@chromium.org
Labels: -Type-Bug -Pri-2 Proj-Headless M-57 hasbisect Pri-1 Type-Bug-Regression
Owner: skyos...@chromium.org
Status: Assigned (was: Unconfirmed)
Getting 'Cannot start http server for devtools.Stop devtools' on Linux Ubuntu 14.04 on the reported version(57.0.2970.0) and the latest Dev(57.0.2979.0) when trying step-1. Attached is the screenshot of the terminal.

However the same works fine on 57.0.2950.0 when running step #1 and user agent of the site is shown as foo bar. 57.0.2951.0 showed 'Illegal instruction core dumped' when executing test step #1.

Considering below as the changelog:
===================================
https://chromium.googlesource.com/chromium/src/+log/57.0.2950.0..57.0.2951.0?pretty=fuller&n=10000

skyostil@: Could this be related to runtime headless mode for Linux: https://codereview.chromium.org/1991953002. (CL was landed-reverted-again relanded).

Please help in investigating this further.

Thank you!

Comment 3 by ajha@chromium.org, Jan 16 2017

680405.png
244 KB View Download

Comment 4 by lawn...@gmail.com, Jan 26 2017

> Getting 'Cannot start http server for devtools.Stop devtools' on Linux Ubuntu 14.04

I reported this for 16.04.1. I did not attempt to repro this bug on 14.04.
Status: WontFix (was: Assigned)
User agent overriding in Headless is exposed through DevTools: https://chromedevtools.github.io/debugger-protocol-viewer/tot/Network/#method-setUserAgentOverride

Comment 6 by lawn...@gmail.com, Apr 4 2017

Will this work when driving the headless browser via Selenium?
#6: Yes, ChromeDriver is being changed to support this: https://codereview.chromium.org/2785083002/ (however it looks like we may need to support --user-agent after all)

Sign in to add a comment