-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Allow custom user-agent via --extra-headers #8756
Comments
Would this work for setting a custom UA under mobile emulation as well? AFAIK even with |
@wildlyinaccurate I mean, it's all up to implementation… but my pitch would be to make whatever It should override emulation, for sure. 👍 |
I'm not 100% sold on this one. I think in order for us to use the user-agent you should have specified a different or no device emulation. Otherwise you can find yourself in unexpected and inconsistent device setups like a desktop user agent but emulating a nexus 5x... WDYT about warning as a first step? |
We'll cover this as part of #10910 |
@benschwarz my plan is to expose a |
@paulirish, that sounds helpful — we're still using For brevity, those blocked methods are: |
Chrome requires custom user agents to be set using
Network.setUserAgentOverride
rather than accepting a user-agent to be set as additional HTTP headers.This is confusing to users and a weird quirk of the devtools API that should not be exposed to users of Lighthouse.
My proposal is that we add a check to see if there are any headers set, detect the
User-agent
header if present and apply it usingNetwork.setUserAgentOverride
.As an example:
💁♂️ No longer will people need to set user-agent as a chrome flag.
The text was updated successfully, but these errors were encountered: