Skip to content

Extra HTTP headers aren't applied to requests made by Web Workers #3578

Backlog

Description

@shrey150

context.setExtraHTTPHeaders() and page.setExtraHTTPHeaders() apply to the worker's script request, but not to requests the worker makes itself (e.g. fetch() inside a dedicated worker). Playwright sends the merged context + page headers on those requests too.

await stagehand.browser.context.setExtraHTTPHeaders({ "x-ctx": "1" });
await page.setExtraHTTPHeaders({ "x-page": "1" });
await page.goto(url); // page runs: new Worker("/worker.js")
// worker.js: fetch("/api/data")

Expected: GET /api/data carries x-ctx and x-page, matching Playwright.
Actual: neither header is sent.

Follow-up to #3460, which fixed merging between the context and page levels.

Activity

  1. MannXo commented on Nov 30, 2026

    @MannXo

    I'll work on this one , can I get assigned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions