[Bug]: Browser plugin — ignoreHTTPSErrors and bypassCSP are set in two places and applied in neither
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 70/100
Direzione di ricerca
Start with the three reported entry points: Client::connectTo(), BrowserFactory::launch(), and PendingAwaitablePage::buildAwaitablePage(). Trace how the two options are filtered or serialized, then verify that both are passed to Browser.newContext and removed from the launch paths. Use the reported grep command and inspect the existing browser tests; done means the options reach the context API without breaking current behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What Happened
In pestphp/pest-plugin-browser (5.x), both ignoreHTTPSErrors and bypassCSP get set in the client, but neither reaches a Playwright API that takes them. So neither is actually on.
Client::connectTo() puts them in the websocket launch-options query. The server runs that through filterLaunchOptions(), which is a whitelist: channel, args, ignoreAllDefaultArgs, ignoreDefaultArgs, timeout, headless, proxy, chromiumSandbox, firefoxUserPrefs, slowMo, executablePath, downloadsPath, artifactsDir. Neither one's in there, so headless makes it through and the other two get dropped.
BrowserFactory::launch() sends them as BrowserType.launch params instead. scheme.BrowserTypeLaunchParams doesn't have either, and tObject builds its result by walking the schema's keys — so anything it doesn't know about just disappears, no error. (ignoreHttpsErrors there has a lowercase t as well, where Playwright writes ignoreHTTPSErrors. Doesn't matter, the key gets dropped either way.)
The place Playwright does take them is Browser.newContext; scheme.BrowserNewContextParams has both. The plugin's only newContext() call sits in PendingAwaitablePage::buildAwaitablePage() and passes locale, timezoneId, colorScheme, the device context and the user's options. Neither of these.
Fix is probably just moving both into the newContext() options and dropping them from the two launch paths.
How to Reproduce
I should be straight about this: I found it by reading the code on both sides, not by hitting it in a suite. So here's how to check the claim rather than a failing test.
In the plugin, grep -rn 'ignoreHTTPSErrors\|ignoreHttpsErrors\|bypassCSP' src/ returns exactly three lines — two in Client.php, one in BrowserFactory.php, and nothing in the newContext() call.
In node_modules/playwright-core/lib/coreBundle.js, filterLaunchOptions() shows the whitelist, scheme.BrowserTypeLaunchParams shows neither key, scheme.BrowserNewContextParams shows both, and tObject shows unknown keys being dropped without an error.
What I'd expect at runtime, though I haven't run it: visit() against an HTTPS host whose certificate the browser doesn't trust should die on the certificate, which is the thing ignoreHTTPSErrors is there to prevent. Nothing in the plugin's suite would catch it either way — the one HTTPS test hits https://example.com, which has a valid cert.
For bypassCSP I couldn't work out what it would break at all. Playwright pushes addInitScript and evaluate through CDP, and page CSP doesn't touch those. It's set, it doesn't arrive, and I don't know whether anything cares.
Pest Version
pestphp/pest-plugin-browser at 5.x (composer requires pestphp/pest: ^5.0.4), with the pinned playwright: ^1.62.1. Verified against [email protected] sources.
PHP Version
8.4+ (the plugin requires ^8.4); this is protocol-level and doesn't depend on the PHP version.
Operation System
Not platform-specific — the options are dropped by the Playwright server's own option filter and protocol validator, so it happens the same everywhere.
- Lingua principale
- PHP
- Stelle
- 11.8k
- Fork
- 559
- Merge medio
- 5g 23h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 pestphp/pest
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
[Bug]: --mutate hides unreadable files, so mutants behind a failed read can never be killedForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 5 giorni
-
[Bug]: [mutate] Windows: @pest-mutate-ignore comments land on line 1 in files with LF line endingsForse già presa @webdevsamran l’ha presa 57 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 5 giorni
-
[pest-plugin-browser] Page::waitForLoadState() never sends its message — waitForEvent() is a silent no-opForse già presa @asllanmaciel l’ha presa 70 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
pestphp/pest#1892 · 2 commenti ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di pestphp/pest
Issue simili
-
Group 2 - Data Storage | Tripal DBX | Chado Group 5 - Search | ElasticSearch | Views Priority - Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
nginx update required due to NGINX2RootForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
mailcow/mailcow-dockerized#7668 · 5 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
lara-zeus/spatie-translatable#80 ·
I maintainer di solito rispondono entro 1 giorno
-
small
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
uiowa/uiowa#10296 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
asyncapi/modelina#2709 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno