-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[Bug]: response.allHeaders() hangs for Worker script loaded inside an iframe (Chromium only) #39948
Copy link
Copy link
Open
Labels
Description
Version
1.58.2
Steps to reproduce
Reproduction is also available in https://try.playwright.tech/?l=javascript&s=m9zi4si
- Clone the repo:
git clone https://github.com/adi-benz/playwright-ww-iframe-hang-bug.git npm installnpx playwright install chromiumnode repro.js- Observe that
response.allHeaders()hangs indefinitely on the/worker.jsrequest
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:
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)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.2Reactions are currently unavailable