[Bug]: WebKit decodes HTML from route.fulfill() as windows-1252, ignoring charset=utf-8
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
Start by tracing how WebKit handles responses created by route.fulfill() and how it sets response headers and encodes the body; compare that path with the real HTTP response behavior described here. The payload does not name source files or tests, so locate the relevant WebKit route fulfillment code and its tests. Done when the fulfilled HTML reports UTF-8 and preserves ₹, matching Chromium, Firefox, and WebKit's real server response.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
1.64.1 (also 1.58.2 and 1.65.0-alpha-2026-10-26)
Steps to reproduce
In an empty directory on Ubuntu 24.04, run:
npm init -y
npm install [email protected]
npx playwright-core install --with-deps webkit
Save the following as repro.mjs (UTF-8), then run node repro.mjs:
import { webkit } from "playwright-core";
const browser = await webkit.launch();
const page = await browser.newPage();
await page.route("http://fulfill.test/**", (route) =>
route.fulfill({ contentType: "text/html; charset=utf-8", body: "<!doctype html><p>₹</p>" }),
);
await page.goto("http://fulfill.test/");
console.log(await page.evaluate(() => [document.characterSet, document.querySelector("p").textContent]));
await browser.close();
Expected behavior
[ 'UTF-8', '₹' ], as in Chromium and Firefox, and as WebKit gives when a real HTTP server sends the same Content-Type: text/html; charset=utf-8 header.
Actual behavior
[ 'windows-1252', '₹' ]. It's the same with headers: { "Content-Type": "text/html; charset=utf-8" } instead of contentType, with a Buffer body, and with text/html;charset=UTF-8.
| Response | Chromium 156 | Firefox 157 | WebKit 27.2 |
|---|---|---|---|
route.fulfill({ contentType, body: string }) |
UTF-8 ₹ | UTF-8 ₹ | windows-1252 ₹ |
route.fulfill({ headers, body: string }) |
UTF-8 ₹ | UTF-8 ₹ | windows-1252 ₹ |
route.fulfill({ contentType, body: Buffer }) |
UTF-8 ₹ | UTF-8 ₹ | windows-1252 ₹ |
route.fulfill({ status: 200, headers: { "content-type": "text/html;charset=UTF-8" }, body: Buffer }) |
UTF-8 ₹ | UTF-8 ₹ | windows-1252 ₹ |
| Real HTTP server, same header | UTF-8 ₹ | UTF-8 ₹ | UTF-8 ₹ |
Additional context
We hit this in a test whose fulfilled page embeds a srcdoc iframe containing an inline script with non-ASCII text, allowed by a CSP sha256- hash. Incorrect decoding of the outer page changed the iframe's script text, so its hash no longer matched and WebKit refused to run it. Adding <meta charset="utf-8"> to the fulfilled page works around it.
Environment
System:
OS: Linux 7.2 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat)
CPU: (16) x64 AMD Ryzen 9 8945HS w/ Radeon 780M Graphics
Memory: 5.44 GB / 14.91 GB
Container: Yes
Binaries:
Node: 24.19.0 - /opt/acttoolcache/node/24.19.0/x64/bin/node
npm: 11.17.0 - /opt/acttoolcache/node/24.19.0/x64/bin/npm
Languages:
Bash: 5.2.21 - /usr/bin/bash
npmPackages:
playwright-core: ^1.64.1 => 1.64.1
- Lingua principale
- TypeScript
- Stelle
- 98.5k
- Fork
- 6.7k
- Merge medio
- 16h 5m
- PR unite (30g)
- 286
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/playwright
-
[Bug]: `playwright install` hangs silently for ~8 minutes when PLAYWRIGHT_BROWSERS_PATH is not writableForse già presa @dcrousso l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/playwright#43606 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Set `this.name` in `TargetClosedError` constructorForse di nuovo libera @LeonxLJX l’ha presa 53 giorni fa e non c’è nessuna pull request aperta. ApertaP3-collecting-feedback
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
microsoft/playwright#42522 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
microsoft/playwright#43655 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: UI mode fails with spawn EBADF on macOS when the test directory contains more than ~10k filesAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
microsoft/playwright#43653 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: frame.content() on a frame whose document never arrives hangs forever, even after the page is closedForse già presa @microsoft-playwright-automation l’ha presa oggi. Apertaneeds-triage-linux
Difficoltà 4/5 1-2 giorni Idoneità per principianti 35/100
microsoft/playwright#43647 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/playwright
Issue simili
-
verified
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anomalyco/opencode#59589 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: During run init command, finish the git initialize process without question to user('Initialize a new git repository?')Forse già presa @nishu-murmu l’ha presa oggi. Apertapending-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
wxt-dev/wxt#2697 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
knaw-huc/textannoviz#739 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno