Skip to content

Conversation

@hbenl
Copy link
Collaborator

@hbenl hbenl commented Oct 31, 2025

Fixes #38060 and the following tests:

  • tests/library/browsercontext-locale.spec.ts:
    • "should affect accept-language header"
  • tests/library/browsercontext-set-extra-http-headers.spec.ts:
    • "should override extra headers from browser context"
  • tests/library/defaultbrowsercontext-2.spec.ts:
    • "should support extraHTTPHeaders option"
  • tests/library/popup.spec.ts:
    • "should inherit extra headers from browser context"
  • tests/page/page-route.spec.ts:
    • "should show custom HTTP headers"
    • "should work with custom referer headers"
    • "should send referer"
  • tests/page/page-set-extra-http-headers.spec.ts:
    • "should work"
    • "should work with redirects"
    • "should work with extra headers from browser context"
    • "should not duplicate referer header"

@hbenl hbenl force-pushed the set-extra-headers branch from 4026de4 to eecb28a Compare October 31, 2025 15:26
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Test results for "MCP"

2588 passed, 116 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Test results for "tests 1"

1 failed
❌ [playwright-test] › runner.spec.ts:118 › should ignore subprocess creation error because of SIGINT @macos-latest-node18-2

4 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-goto.spec.ts:83 › should work with Cross-Origin-Opener-Policy `@firefox-ubuntu-22.04-node18`
⚠️ [playwright-test] › ui-mode-test-shortcut.spec.ts:103 › should toggle Terminal `@windows-latest-node18-2`

40317 passed, 789 skipped


Merge workflow run.

@dgozman dgozman requested a review from yury-s November 6, 2025 22:20
async doUpdateExtraHTTPHeaders(): Promise<void> {
let allHeaders = this._options.extraHTTPHeaders || [];
if (this._options.locale)
allHeaders = network.mergeHeaders([allHeaders, network.singleHeader('Accept-Language', this._options.locale)]);
Copy link
Member

Choose a reason for hiding this comment

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

I see that we set this custom header on the client end in both Firefox and WebKit in Playwright, but it feels like cutting corners a bit and I wonder if it'd make more sense to make it a part of the browser implementation of the emulation.setLocaleOverride command (similar how it is done in Chromium)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wonder if it'd make more sense to make it a part of the browser implementation of the emulation.setLocaleOverride command (similar how it is done in Chromium)?

That's the plan. I will remove this logic when the spec and Firefox' implementation have been updated.

@yury-s yury-s merged commit 9212916 into microsoft:main Nov 7, 2025
34 of 37 checks passed
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.

[Feature]: Implement "network.setExtraHeaders" for WebDriver BiDi

2 participants