Skip to content

Conversation

sadym-chromium
Copy link
Contributor

@sadym-chromium sadym-chromium commented Aug 19, 2025

Support for user-agent emulations. Required for WebDriver BiDi: https://www.w3.org/TR/webdriver-bidi/#command-emulation-setUserAgentOverride.

Rely on environment default User-Agent value to emulate user agent.

(See WHATWG Working Mode: Changes for more details.)


/infrastructure.html ( diff )
/system-state.html ( diff )

sadym-chromium added a commit to w3c/webdriver-bidi that referenced this pull request Sep 10, 2025
Specification for `emulation.setUserAgentOverride` command. 
* Introduce a new hook "WebDriver BiDi emulated User-Agent".
* Fetch spec update required, as the default `User-Agent` headers is set BEFORE the "[WebDriver BiDi before request sent](https://w3c.github.io/webdriver-bidi/#webdriver-bidi-before-request-sent)" is invoked, so there is no way to distinguish between the user explicitly set the `User-Agent` vs the [default `User-Agent` value](https://fetch.spec.whatwg.org/#default-user-agent-value) was used. Use the hook in Fetch spec: whatwg/fetch#1851
* HTML spec update required to return the proper `User-Agent` as the result of the `navigator.userAgent`. Use the hook in HTML spec: whatwg/html#11576
@sadym-chromium sadym-chromium force-pushed the sadym/emulation.setUserAgentOverride branch from ba6e334 to 426e4b3 Compare September 16, 2025 12:09
@sadym-chromium sadym-chromium marked this pull request as ready for review September 16, 2025 13:33
@annevk annevk merged commit 214f897 into whatwg:main Sep 17, 2025
2 checks passed
@annevk
Copy link
Member

annevk commented Sep 17, 2025

Thanks @sadym-chromium!

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

Successfully merging this pull request may close these issues.

3 participants