-
Notifications
You must be signed in to change notification settings - Fork 59
emulation.setUserAgentOverride
#947
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
base: main
Are you sure you want to change the base?
Conversation
e22449c
to
989153d
Compare
8cb52cd
to
cb5185a
Compare
9d80a52
to
7c20e1a
Compare
@OrKoN @juliandescottes please take a look |
7c20e1a
to
b024ff2
Compare
@juliandescottes please take a look |
@juliandescottes @whimboo PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sadym-chromium ! Overall that looks fine to me. Just some nits and suggestions. Before approving I just want to check the reason why we attach this to the session rather than to the remote end. Back to you
Initial draft of `emulation.setUserAgentOverride` command. Requires defining a list of related navigables for the "default User-Agent value" caller. # Conflicts: # index.bs
b024ff2
to
9cfb02e
Compare
Co-authored-by: Julian Descottes <jdescottes@mozilla.com>
b9c9a42
to
017d873
Compare
Co-authored-by: Julian Descottes <jdescottes@mozilla.com>
@juliandescottes PTAL I believe I addressed your comments, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I didn't notice that the context/contexts error was also in the other commands. Thanks for fixing them as well. Looks good to me now!
|
||
1. If |command parameters| [=map/contains=] "<code>userContexts</code>" | ||
and |command parameters| [=map/contains=] "<code>contexts</code>", | ||
return [=error=] with [=error code=] [=invalid argument=]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to fail if whether userContexts
nor contexts
are given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not in this case, if none are given we set it globally)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait. So emulating the user agent will be the first emulation command that will allow us to set some overrides globally? Is that something that we discussed / agreed on - maybe I missed it because I have to leave early from the W3C meetings?
|
||
1. Let |emulated user agent| be |command parameters|["<code>userAgent</code>"]. | ||
|
||
1. If |command parameters| [=map/contains=] "<code>contexts</code>": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind using the same phrasing as for all the other emulation commands?
Specification for
emulation.setUserAgentOverride
command.User-Agent
headers is set BEFORE the "WebDriver BiDi before request sent" is invoked, so there is no way to distinguish between the user explicitly set theUser-Agent
vs the defaultUser-Agent
value was used. Use the hook in Fetch spec: [WebDriver BiDi] emulateuser-agent
string whatwg/fetch#1851User-Agent
as the result of thenavigator.userAgent
. Use the hook in HTML spec: [WebDriver BiDi] emulateuser-agent
string whatwg/html#11576Preview | Diff