[BUG] WebKit (Linux): Assertion error in WKPage._onTargetCreated on a cross-site redirect chain
Maintainer thường phản hồi trong vòng 1 ngày
@yury-s đang làm issue này rồi.
Từ ngày 6/10/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Start at WKPage._onTargetCreated and inspect the page-goto.spec.ts regression test named “should work with cross-process redirect chain through visited sites.” Reproduce the Linux WebKit redirect chain with repro.mjs, then verify the assertion is avoided and navigation reaches /done while the regression test passes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
1.63.0 (WebKit r2359); also current main (WebKit r2369). 1.64.0-alpha-2026-10-02 is affected as well.
Environment
- Linux:
mcr.microsoft.com/playwright:v1.63.0-noble, GitHububuntu-24.04runners. Headless, and headed underxvfb-run. - macOS (WebKit r2369): not affected.
Steps to reproduce
Three loopback hosts act as three sites: localhost (C), 127.0.0.1 (B), [::1] (A).
The page visits C → B → A by clicking links. A form on A then posts to /go, which returns a 302 to B/hop, which returns a 302 to C/done.
// repro.mjs: node repro.mjs (env: VARIANT=get, PRE=c,b (default), N=3, HEADED=1)
import http from 'node:http';
import { webkit } from 'playwright';
const PORT = 8123;
const H = { a: '[::1]', b: '127.0.0.1', c: 'localhost' };
const method = process.env.VARIANT === 'get' ? 'get' : 'post';
const pre = (process.env.PRE ?? 'c,b').split(',').filter(Boolean);
const server = http.createServer((req, res) => {
const u = new URL(req.url, `http://${req.headers.host}`);
const next = u.searchParams.get('next');
if (u.pathname === '/page') {
res.writeHead(200, { 'content-type': 'text/html' });
const href = next ? `http://${H[next.split(',')[0]]}:${PORT}/page?next=${next.split(',').slice(1).join(',')}` : '/form';
res.end(next ? `<a href="${href}">next</a>` : `<form method="${method}" action="/go"><button>go</button></form>`);
} else if (u.pathname === '/go') {
req.resume(); res.writeHead(302, { location: `http://${H.b}:${PORT}/hop` }); res.end();
} else if (u.pathname === '/hop') {
res.writeHead(302, { location: `http://${H.c}:${PORT}/done` }); res.end();
} else {
res.writeHead(200, { 'content-type': 'text/html' }); res.end('<h1>done</h1>');
}
});
await new Promise(r => server.listen(PORT, '::', r));
const browser = await webkit.launch({ headless: !process.env.HEADED });
let fails = 0;
const N = Number(process.env.N || 3);
for (let i = 0; i < N; i++) {
const page = await browser.newPage();
try {
const hosts = [...pre, 'a'];
await page.goto(`http://${H[hosts[0]]}:${PORT}/page?next=${hosts.slice(1).join(',')}`);
for (let k = 1; k < hosts.length; k++) {
await page.getByRole('link', { name: 'next' }).click();
await page.waitForURL(url => url.host.startsWith(H[hosts[k]]));
}
await page.getByRole('button', { name: 'go' }).click();
await page.waitForURL(/\/done$/, { timeout: 10_000 });
console.log(`run ${i}: ok ${page.url()}`);
} catch (e) {
fails++; console.log(`run ${i}: FAIL ${String(e.message).split('\n')[0]}`);
}
await page.close().catch(() => {});
}
console.log(`variant=${method} pre=${pre.join('>')}>a fails=${fails}/${N}`);
await browser.close(); server.close();
docker run --rm --ipc=host -v "$PWD":/w -w /w mcr.microsoft.com/playwright:v1.63.0-noble \
bash -c 'npm i --silent [email protected] >/dev/null && node repro.mjs'
Expected behavior
The page lands on http://localhost:8123/done, as it does on macOS.
Actual behavior
On the first run, the driver process crashes with an unhandled assertion:
Error: Assertion error
at assert (playwright-core/lib/coreBundle.js:838)
at _WKPage._onTargetCreated (playwright-core/lib/coreBundle.js:47026)
at WKSession.emit ...
In the test runner, the assertion is swallowed and the navigation times out instead.
It reproduces with POST and with GET. It does not reproduce when only one of B and C was visited before, or neither (PRE=b, PRE=).
Analysis
Protocol sequence on Linux:
Target.targetCreated page-25 {isProvisional:true} // swap #1, after the 302 from A to B
[page-25] requestWillBeSent http://127.0.0.1/hop
[page-25] Page.willCheckNavigationPolicy
Target.targetCreated page-28 {isProvisional:true} // swap #2 while page-25 is still provisional -> assert(!this._provisionalPage)
Target.targetDestroyed page-25 // old provisional target is destroyed only after the new one is created
On macOS, provisional page-30 follows the /hop → /done redirect itself and commits, so there is no second swap.
On Linux, WebKit swaps processes again for the redirect target before the first provisional page commits, and it creates the new target before it destroys the old one.
WKPage._onTargetCreated asserts that no provisional page exists yet.
This is a different cause from #37766 (a WebKit SIGABRT on reload) and #42957 (COOP). No COOP/COEP headers are involved.
Proposed fix
In WKPage._onTargetCreated, when a provisional target arrives while _provisionalPage is set, dispose the stale provisional page instead of asserting.
The targetDestroyed that follows for the old id then matches nothing and is a no-op.
A PR with this fix and a regression test (page-goto.spec.ts › should work with cross-process redirect chain through visited sites) follows.
- Ngôn ngữ chính
- TypeScript
- Star
- 100k
- Fork
- 6.9k
- Merge trung bình
- 16 giờ 8 phút
- Pull request đã merge (30 ngày)
- 281
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/playwright
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/playwright#44289 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-triage-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/playwright#44264 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] WebKit keeps every removed iframe's JS heap alive (memory grows until the page crashes)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
microsoft/playwright#44290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Regression]: requestFullscreen() in a popup rejects with "not granted" in 1.65 (Chromium 159)Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
microsoft/playwright#44288 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
microsoft/playwright#44287 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/playwright
Issue tương tự
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openclaw/openclaw#203385 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nwverse/persona#12800 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WISE-Community/WISE-Client#2404 ·
Maintainer thường phản hồi trong vòng 1 ngày