Skip to content

[Bug]: response.allHeaders() hangs for Worker script loaded inside an iframe (Chromium only) #39948

Closed

Description

Version

1.58.2

Steps to reproduce

Reproduction is also available in https://try.playwright.tech/?l=javascript&s=m9zi4si

  1. Clone the repo: git clone https://github.com/adi-benz/playwright-ww-iframe-hang-bug.git
  2. npm install
  3. npx playwright install chromium
  4. node repro.js
  5. Observe that response.allHeaders() hangs indefinitely on the /worker.js request
    The bug requires the combination of an iframe + Web Worker

Expected behavior

I expect the call to response.allHeaders() on line 38 to return the headers, but it's stuck indefinitely.
I expect to be able to read the headers after I get a callback from page.on('requestfinished').

I noticed that to reproduce this bug there needs to be a combination of an iframe + Web Worker, two additional scripts are provided in the Git repo to show that:

  1. working-no-iframe.js - same setup but Worker is created in the main page (no iframe) → no hang (https://try.playwright.tech/?l=javascript&s=br8eaks)
  2. working-firefox.js - same setup but using Firefox instead of Chromium → no hang

Actual behavior

The call to response.allHeaders() hangs on Chromium, output shows:

HUNG after 5s on: http://localhost:39145/worker.js
ERROR: response.allHeaders: Target page, context or browser has been closed

Additional context

No response

Environment

System:
  OS: macOS 26.4
  CPU: (16) arm64 Apple M4 Max
  Memory: 644.53 MB / 64.00 GB
Binaries:
  Node: 25.8.1 - /opt/homebrew/bin/node
  npm: 11.11.0 - /opt/homebrew/bin/npm
  pnpm: 10.33.0 - /opt/homebrew/bin/pnpm
IDEs:
  Claude Code: 2.1.72 - /opt/homebrew/bin/claude
  opencode: 1.3.0 - /opt/homebrew/bin/opencode
Languages:
  Bash: 5.3.3 - /opt/homebrew/bin/bash
npmPackages:
  playwright: ^1.58.2 => 1.58.2

Activity

  1. Skn0tt commented on Mar 31, 2026

    @Skn0tt
    Contributor

    This regressed in #34400, so it seems similar to #35678. Dmitry Gozman (@dgozman) could you take a look?

  2. scarab-systems commented on Jun 10, 2026

    @scarab-systems

    Thanks for the report and for the pointer to the PlzDedicatedWorker regression path. I reproduced this locally on macOS arm64 against current main and have a small patch that keeps the existing extra-info behavior for normal requests, but falls back to provisional raw headers when a worker-main-script request finishes in a worker-frame session without matching extra-info events.

    Local validation:

    • focused regression fails without the source fix and passes with it
    • npm run ctest -- tests/page/workers.spec.ts --workers=1 --reporter=line
    • npm run ctest -- tests/page/page-network-response.spec.ts --workers=1 --reporter=line
    • npm run lint

    I noticed the contribution policy asks contributors to wait for assignment or explicit community approval before opening a PR, so I’ll wait rather than open one unsolicited. Happy to send the patch if maintainers want it.

  3. scarab-systems commented on Jun 25, 2026

    @scarab-systems

    Thanks, that makes sense. I’ll stand down on the Playwright-side patch and watch for the Chromium fix to flow through.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions