Re: [whatwg/fetch] [WebDriver BiDi] emulate `user-agent` string (PR #1851)

sadym-chromium left a comment (whatwg/fetch#1851)

> I think that does mean there are some issues with this setup. In that if you hit a couple of redirects and you call that method repeatedly, the User-Agent header would not change in value, but per this specification as written it ought to change.
> 
> To fix that and some race issues we'd have to grab the current User-Agent header before we go in parallel and use it for the entire duration of the fetch. I'm okay with not doing that for now, but I'm curious what other people think about what level of accuracy we need here. Maybe @jgraham is willing to chime in.

The WebDriver BiDi ["WebDriver BiDi emulated User-Agent"](https://www.w3.org/TR/webdriver-bidi/#webdriver-bidi-emulated-user-agent) hook returns the emulated user context based on pre-configured emulations per top-level navigable, so it is not expected to be changed during navigations or redirects. Even though the JS environments will be changed, it would not influence the return result. BiDi uses the environment only to associate the request with the navigable.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1851#issuecomment-3299452273
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1851/c3299452273@github.com>

Received on Tuesday, 16 September 2025 16:10:21 UTC