Skip to content

emulation.setClientHintsOverride -> userAgentClientHints.setClientHintsOverride#393

Merged
arichiv merged 3 commits into
WICG:mainfrom
sadym-chromium:sadym/userAgentClientHints.setClientHintsOverride
Feb 10, 2026
Merged

emulation.setClientHintsOverride -> userAgentClientHints.setClientHintsOverride#393
arichiv merged 3 commits into
WICG:mainfrom
sadym-chromium:sadym/userAgentClientHints.setClientHintsOverride

Conversation

@sadym-chromium

@sadym-chromium sadym-chromium commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Addressing #391 by moving command to a dedicated userAgentClientHints domain.


Preview | Diff

@whimboo whimboo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The renaming looks fine to me but I have a couple more questions regarding the overall steps and internal data definitions. If those should be on its own PR feel free to move them out.

Comment thread index.bs
Comment thread index.bs
Comment thread index.bs
Comment thread index.bs Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For our BiDi emulation commands we have such maps on the BiDi session or remote end. Could we use the remote end definition from BiDi here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For our BiDi emulation commands we have such maps on the BiDi session or remote end. Could we use the remote end definition from BiDi here?

This spec uses term "user agent" as a synonym to WebDriver's "remote end".

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what should we follow then? Has the term from the actual spec the precedence I assume?

CC @jgraham.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec gets to decide on its own internal definitions.

However.

The Infra definition of "user agent" is understood to be closer to WebDriver BiDi's "user context" than "remote end". Therefore, without any further investigation, if you are trying to use it for the latter you might be wrong.

(I think Infra made a mistake here; the argument is basically that web specs can't see outside their own storage partition anyway, so from their point of view defining a "user agent" as a single storage partition makes things easier because it's the biggest domain that a web spec might want to address. But of course that's not what anyone else means by "user agent" and WebDriver can see outside specific storage partitions, so it just means we need to avoid the term)

Comment thread index.bs Outdated
Comment on lines 1080 to 1085
@@ -1084,28 +1084,28 @@
* [=struct/item=] named <dfn for="emulated client hints" export>emulated client hints per navigables</dfn>,
which is a weak map between [=/navigables=] and [=user agent client hints=], initially empty.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other emulation commands need only a single map. Why do we have to maintain three of them for this command?

@sadym-chromium sadym-chromium Jan 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other emulation commands need only a single map. Why do we have to maintain three of them for this command?

This approach was suggested by extra headers and is used in several places in the main spec. I personally find it more readable and structured. Also it allows for more explicit global settings handling:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I read this wrongly. It's a single struct with individual maps as properties. That's fine then.

Comment thread index.bs

1. If |command parameters| [=map/contains=] "<code>userContexts</code>"
and |command parameters| [=map/contains=] "<code>contexts</code>",
return [=error=] with [=error code=] [=invalid argument=].

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if the order of the steps would be equal to those that we have in our BiDi spec, which would make it much easier to parse and implement. Maybe this can be fixed? Also I do not see a step that checks that at least contexts or userContexts are present.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I do not see a step that checks that at least contexts or userContexts are present.

It is allowed to skip both contexts or userContexts and it would mean global setting. w3c/webdriver-bidi#956

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, Not all of our existing emulation commands support that yet and I actually checked only those. :/ Thanks for pointing out.

@sadym-chromium sadym-chromium force-pushed the sadym/userAgentClientHints.setClientHintsOverride branch from 912bf7e to ca4a72b Compare January 21, 2026 13:34

@whimboo whimboo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this looks fine but I would like to have @jgraham taking the review as well from our side.

Comment thread index.bs Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what should we follow then? Has the term from the actual spec the precedence I assume?

CC @jgraham.

Comment thread index.bs Outdated
Comment on lines 1080 to 1085
@@ -1084,28 +1084,28 @@ A [=User agent=] has <dfn>emulated client hints</dfn>, which is a [=struct=] wit
* [=struct/item=] named <dfn for="emulated client hints" export>emulated client hints per navigables</dfn>,
which is a weak map between [=/navigables=] and [=user agent client hints=], initially empty.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I read this wrongly. It's a single struct with individual maps as properties. That's fine then.

@jgraham

jgraham commented Jan 27, 2026

Copy link
Copy Markdown

Now that it's using its own namespace I don't have further concerns.

@whimboo

whimboo commented Jan 27, 2026

Copy link
Copy Markdown

@miketaylr can you please review these changes? Thanks!

@sadym-chromium sadym-chromium force-pushed the sadym/userAgentClientHints.setClientHintsOverride branch from 3e5636e to e85e188 Compare February 9, 2026 09:53
@sadym-chromium

Copy link
Copy Markdown
Contributor Author

@miketaylr PTAL

@miketaylr

Copy link
Copy Markdown
Collaborator

Apologies for the delay - have been traveling for summits. @arichiv, do you mind reviewing? It may be a few days before I can take a look.

@arichiv arichiv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable overall, not fully read-in on the motivation but if it makes web-driver side people happy the changes here seem mostly like a no-op (better defined, no changes in Chrome required).

Comment thread index.bs
@sadym-chromium

Copy link
Copy Markdown
Contributor Author

@arichiv please consider merging

@arichiv arichiv merged commit 6cf1025 into WICG:main Feb 10, 2026
2 checks passed
github-actions Bot added a commit that referenced this pull request Feb 10, 2026
…s.setClientHintsOverride

SHA: 6cf1025
Reason: push, by arichiv

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
sadym-chromium added a commit to web-platform-tests/wpt that referenced this pull request Feb 10, 2026
sadym-chromium added a commit to GoogleChromeLabs/chromium-bidi that referenced this pull request Feb 10, 2026
…tClientHintsOverride` (#4053)

Follow-up after WICG/ua-client-hints#393

---------

Signed-off-by: Browser Automation Bot <browser-automation-bot@google.com>
Co-authored-by: Browser Automation Bot <browser-automation-bot@google.com>
foolip pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 10, 2026
sadym-chromium added a commit to GoogleChromeLabs/chromium-bidi that referenced this pull request Feb 11, 2026
…tClientHintsOverride` (#4053)

Follow-up after WICG/ua-client-hints#393

---------

Signed-off-by: Browser Automation Bot <browser-automation-bot@google.com>
Co-authored-by: Browser Automation Bot <browser-automation-bot@google.com>
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Feb 16, 2026
…sOverride` -> `userAgentClientHints.setClientHintsOverride`, a=testonly

Automatic update from web-platform-tests
[wdspec] rename `emulation.setClientHintsOverride` -> `userAgentClientHints.setClientHintsOverride` (#57681)

Follow-up after WICG/ua-client-hints#393
--

wpt-commits: 014898d321c48cff1d98f5dfb03d116e7210c13f
wpt-pr: 57681
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants