Skip to content

Override "Accept-Language" header if WebDriver BiDi emulated language is present. - #1869

Merged
annevk merged 9 commits into
whatwg:mainfrom
lutien:add-emulation-of-accept-language
Nov 19, 2025
Merged

annevk merged 9 commits into
whatwg:mainfrom
lutien:add-emulation-of-accept-language

Conversation

@lutien

@lutien lutien commented Oct 22, 2025 •

Copy link
Copy Markdown
Contributor

@lutien

lutien commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

@sadym-chromium, could you create an issue for it on your side?

@lutien
lutien marked this pull request as ready for review October 23, 2025 12:21
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
Comment thread fetch.bs Outdated
lutien and others added 4 commits October 23, 2025 14:49
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
@sadym-chromium

sadym-chromium commented Oct 31, 2025 •

Copy link
Copy Markdown
Contributor

@sadym-chromium, could you create an issue for it on your side?

@lutien GoogleChromeLabs/chromium-bidi#3863

@lutien

lutien commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

Hey, @annevk, could you maybe take another look? 🙏🏻

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good modulo some minor grammar and wrapping nits.

Comment thread fetch.bs
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
@annevk

annevk commented Nov 18, 2025

Copy link
Copy Markdown
Member

I hadn't looked at https://w3c.github.io/webdriver-bidi/#webdriver-bidi-emulated-language before but it appears that returns null or a string and we need a byte sequence here. So you need to encode the return value.

@lutien
lutien force-pushed the add-emulation-of-accept-language branch from 7a4cf8f to f861fd2 Compare November 18, 2025 16:45
@lutien

lutien commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

I hadn't looked at https://w3c.github.io/webdriver-bidi/#webdriver-bidi-emulated-language before but it appears that returns null or a string and we need a byte sequence here. So you need to encode the return value.

Ah, right, updated ✅

Comment thread fetch.bs Outdated
<var>request</var>'s <a for=request>client</a>.

<li><p>If <var>emulatedLanguage</var> is non-null, then <a for="header list">append</a>
(`<code>Accept-Language</code>, <var>emulatedLanguage</var>, <a>isomorphic encoded</a>)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's a ` missing. I also find this confusing as this could also be read as a three-tuple.

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.

Alright, I've added "`". And moved encoding into a separate step to avoid having the three-tuple situation.

@lutien
lutien force-pushed the add-emulation-of-accept-language branch from 0985169 to feeb5d9 Compare November 19, 2025 11:13
@annevk
annevk merged commit 60e9ff5 into whatwg:main Nov 19, 2025
2 checks passed
@annevk

annevk commented Nov 19, 2025

Copy link
Copy Markdown
Member

Thanks @lutien!

@lutien
lutien deleted the add-emulation-of-accept-language branch November 19, 2025 13:57
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