Compare commits

...
371 Commits
Author SHA1 Message Date
Federico 57f50f8b80 Le due voci piu' vecchie del changelog puntavano a tag mai esistiti (#86)
[0.1.1] e [0.1.0] rimandavano a compare/v0.1.0...v0.1.1 e releases/tag/v0.1.0.
Nessuno dei due tag esiste: 0.1.0 e 0.1.1 precedono l'arrivo su PyPI, dove
l'indice parte da 0.3.5, e il riempimento dei tag mancanti fatto a suo tempo era
guidato dall'indice, quindi non poteva raggiungerle. Due 404 in fondo a un file
che i lettori aprono per capire cosa e' cambiato.

La prova di dove vivevano c'era: git log -S sul pyproject da 7a983e9 per 0.1.0
("feat: initial public release") e 589c848 per 0.1.1.

Avrei potuto creare i tag, e NON l'ho fatto per un rischio concreto. publish.yml
si innesca sui tag v*, e per una versione che l'indice non serve
already-published non corto-circuita: un tag nuovo su 0.1.0 puo' far partire un
tentativo di pubblicarla. Un link rotto in un changelog storico non vale quel
rischio.

I due link puntano ai commit, che sono la stessa informazione senza inneschi, e
la ragione e' scritta nel file accanto perche' il prossimo che li vede diversi
dagli altri non li "sistemi" trasformandoli in tag.

Verificati entrambi: 200.
2026-08-18 20:57:30 +02:00
Federico 932d8b33b0 Remove ScrapeOrbit from the repo (#84)
The landing page, its stylesheet, its script and the company list it
fell back on, plus the two banner images. Nothing else referenced any
of them.

docs/index.md loses its permalink override and becomes the site home
again: index.html was the root, and without it the root would 404
while every other page kept working. Nothing linked to the old
/overview.html path - the declaration was its only occurrence.
2026-08-18 16:16:52 +02:00
Federico 65b72741a9 Drop the ScrapeOrbit banner from the README (#83)
The empty h2 under it goes too: it was the divider for the promo block,
not for the content, and on its own it renders as a rule above nothing.
2026-08-18 15:30:36 +02:00
Federico 835d6d2904 Il controllo sul registro andava rosso su un rilascio riuscito (#82)
Quarta occorrenza della stessa forma trovata stanotte, e questa non l'ho cercata
io: e' uscita da un audit che ha letto 363 controlli chiedendo a ognuno se puo'
essere verde mentre un rilascio e' a meta'.

Il sotto-controllo sul registro dentro test_the_published_version_has_a_github_release
confronta PUBLISHED.json, letto dall'albero, con le versioni che l'indice serve.
Ma il registro non puo' arrivare su main insieme alla pubblicazione: publish.yml
pubblica su PyPI e poi prova a spingere PUBLISHED.json, main e' protetto e la
spinta diretta viene rifiutata sempre per costruzione, quindi la voce finisce su
un ramo ledger/<versione> la cui PR resta bloccata da sola per il difetto B136
gia' aperto. Fra la pubblicazione e il merge a mano l'indice ha la versione e il
registro no, e il caso e' rosso su un rilascio andato a buon fine.

Nello stesso file, poche righe sotto, c'era gia' l'esenzione scritta un'ora prima
per il gate del changelog: la stessa cura, sul controllo accanto, mai applicata.

Esente e' solo la versione che l'albero DICHIARA nel suo pyproject, e il buco si
richiude da solo: se quel ramo del registro non viene mai unito, al rilascio dopo
la versione rimasta indietro non e' piu' quella dichiarata, ricade in unrecorded
e il caso torna rosso. E' lo stesso modello che il commento accanto descrive gia'
per version_gate, dove una pubblicazione fuori dal cancello resta invisibile fino
al rilascio successivo che la rifiuta.

Provato con l'input noto-cattivo: tolta 0.7.0 dal registro, il caso diventa
rosso; rimessa, torna verde.
2026-08-18 13:46:07 +02:00
github-actions[bot]andfeder-cr 35688cab0f record 0.7.2 as published (#81)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-08-18 11:33:37 +02:00
Federico 2073975413 0.7.2: il pin sale a invisible-core 20.15.0, e il badge dei lanci se ne va (#80)
* 0.7.2: il pin sale a invisible-core 20.15.0, e il badge dei lanci se ne va

Il pin porta agli utenti la correzione del core: un endpoint http:// o https://
passato a build_launch_plan non produceva NESSUNA pref di proxy, e il browser
usciva dall'indirizzo della macchina mentre il livello geografico aveva gia'
risolto fuso, lingua ed egress attraverso il proxy.

Questo wrapper non e' mai stato toccato e chi lo usa non deve fare niente:
consegna l'endpoint a Playwright, ed e' stato misurato - lo stesso IP di uscita
di curl attraverso lo stesso proxy, in http e in socks5. Il pin sale perche' un
consumatore che pinna in modo esatto non puo' restare indietro sull'unica
versione del core che quel difetto non ce l'ha.

Il badge `browser launches` esce dalla README. Il contatore dietro non era un
numero che calcolavamo: era un asset di release ospitato su un repository
cancellato il 2026-08-18, quindi la serie e' ferma sull'ultimo valore vero e il
renderer avrebbe ridisegnato quel numero ogni mattina. Un dato congelato
presentato come corrente e' peggio di nessun dato. La storia non e' toccata e
l'SVG sul ramo badges resta, perche' le pagine PyPI gia' pubblicate lo servono.

Nota sul gate del changelog: fra questo commit e la pubblicazione risulta rosso
con "documented and never published", perche' e' simmetrico e rifiuta anche il
caso opposto. Torna verde quando 0.7.2 e' sull'indice. Non e' stato aggirato.

* Due test dell'aggiornamento erano rossi per costruzione durante ogni rilascio

test_a_hand_pinned_old_core_is_reported_by_pip_check installa il wrapper
DALL'INDICE e poi prendeva cores[-2], la penultima versione del core pubblicata,
dandola per scontata come "piu' vecchia di quella che pinniamo". Quella
assunzione vale solo se la piu' recente sull'indice e' quella che il wrapper
pubblicato pinna, e cade per tutta la durata di un rilascio fatto nell'ordine che
il progetto impone: il core si pubblica PRIMA del consumatore.

Misurato oggi. Pubblicato invisible-core 20.15.0, sull'indice il wrapper era
ancora 0.7.1 che pinna 20.14.0, quindi cores[-2] era proprio 20.14.0: il caso
installava la versione GIUSTA chiamandola sbagliata, pip check rispondeva pulito
perche' l'ambiente era corretto, e il test leggeva quel pulito come una cecita'
del pin. Rosso su un prodotto sano. Il secondo caso, che riusa la stessa fixture,
cadeva di conseguenza: nessuna riparazione da fare, quindi "il core e' ancora
20.14.0".

Corretto all'origine: la versione sbagliata non si sceglie piu' dalla POSIZIONE
sull'indice ma da cio' che il wrapper installato PRETENDE, letto dal suo
Requires-Dist, che e' la sola fonte che non dipende da quante versioni ci siano
ne' dal loro ordine.

Dentro la finestra di rilascio la versione diversa dal pin risulta piu' NUOVA
invece che piu' vecchia. Il meccanismo sotto esame e' il rilevamento di un
DISACCORDO, e un disaccordo verso l'alto e' un disaccordo uguale; il nome del
caso resta com'e' perche' i documenti lo citano e un gate lo verifica.

* Il gate del wheel chiedeva dei file spariti sei settimane fa, e non girava mai

test_built_wheel_has_no_duplicate_entries asseriva che nel wheel ci fossero dei
.json, col commento "the Bayesian data files must still be packaged". E' falso
dal 2026-07-03: il commit 76e41e2, quello che ha creato invisible_core, ha
portato quei dati nel core, e questo pacchetto non ne ha piu' nessuno.

Ha continuato a chiedere una cosa inesistente per sei settimane senza che niente
lo segnalasse, e la ragione e' che il caso e' marcato slow: la selezione di
default lo deseleziona, quindi in CI non ha MAI girato. E' saltato fuori solo
perche' oggi ho lanciato la suite con -m "not e2e", che gli slow li include. Un
gate che non gira e' indistinguibile da uno che passa.

La regressione per cui il caso era stato scritto resta e non e' stata toccata:
un vecchio force-include in pyproject.toml scriveva ogni JSON due volte nello
zip, e PyPI rifiuta un wheel con nomi duplicati. Cambia solo il controllo di
sanita' accanto, che ora chiede cio' che deve valere per QUESTO pacchetto: che
il modulo sia dentro il wheel. E' la stessa classe di guasto - packages che
smette di puntare al sorgente - verificata su una cosa che esiste.

Provato con l'input noto-cattivo: con packages = ["src"] il caso diventa rosso.

* Il gate del changelog rendeva impossibile una PR di rilascio verde

Il gate rifiuta una versione documentata che l'indice non serve, e ha ragione:
esiste perche' un changelog che si ferma a quattro rilasci fa e' peggio di
nessun changelog. Ma la voce di una versione deve stare nel commit che alza la
versione, e in quel momento l'indice non la serve ancora. Quindi ogni PR di
rilascio nasceva rossa, e nessuna sequenza di passi poteva evitarlo: pubblicare
prima di mergiare significherebbe pubblicare da un ramo non mergiato.

Misurato oggi sulla PR #80, dove dopo aver corretto gli altri due difetti questo
era l'UNICO rosso rimasto, su 141 test passati.

La via comoda era togliere la voce dal commit e aggiungerla dopo. Sarebbe stato
curare il sintomo ricreando esattamente il buco che questo gate esiste per
impedire: 0.7.1 e' rimasta senza voce per un giorno intero proprio cosi'.

Corretto all'origine: la versione che l'albero DICHIARA nel suo pyproject e' il
rilascio in corso, non un'invenzione. Ogni altra versione documentata e mai
pubblicata resta un errore, le date restano confrontate con l'upload, e quando
il rilascio atterra quella riga torna sotto la regola generale come le altre.

Provato con due input noto-cattivi, perche' un'esenzione e' il punto in cui un
gate diventa cieco senza dirlo:
  una versione inventata diversa da quella in volo  -> rosso
  una versione pubblicata senza voce                -> rosso
2026-08-18 10:43:27 +02:00
Federico d5d92e8689 0.7.1 era pubblicata da un giorno e non era nel changelog (#79)
* record 0.7.1 as published

* 0.7.1 era pubblicata da un giorno e non era nel changelog

Il gate che confronta l'indice con CHANGELOG.md esiste da tempo e ha fatto il suo
lavoro, ma e' marcato e2e e la selezione di default lo deseleziona: e' scattato
alla prima corsa e2e completa DOPO il rilascio, e quella corsa e' avvenuta per
una ragione che col rilascio non c'entrava niente. Un gate che gira solo quando
qualcuno decide di girarlo non protegge il momento in cui serve.

Nel resto: tolti i riferimenti operativi a invisible_firefox, cancellato il
2026-08-18. Il CHANGELOG resta com'era, perche' e' storia: una riga che dice
"allineato con invisible_firefox 0.2.0" descrive un fatto vero di allora. Sono
cambiate solo le frasi che parlavano al presente di tre repo o due consumatori,
compresi un commento in tests.yml e uno in pyproject.toml, piu' il badge dei
lanci nel README che puntava a una pagina ora 404.

446 test verdi, 0 skipped. e2e sul binario firefox-20: 144 verdi.
2026-08-18 02:52:21 +02:00
github-actions[bot]andfeder-cr 25d7b73659 record 0.7.1 as published (#78)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-08-17 22:12:22 +02:00
Federico 353df4faac 0.7.1: the two gates that approved without looking (#77)
Il font gate confrontava le famiglie contro una lista che era rimasta a 68 mentre
il manifest ne dichiara 71, e la deriva non produceva un rosso: produceva un
verde. La sonda interroga la lista e nient'altro, quindi una famiglia tolta smette
anche di essere cercata, il conto torna da solo e il gate approva restando cieco.
Misurato sul binario vero. Ora un test confronta quella lista con cio' che il core
dichiara, e quel test prima esisteva solo nei documenti.

E il test su enumerateDevices ha due limiti invece di uno, perche' con una soglia
sola una risoluzione soltanto lenta veniva riportata come blocco: il verdetto del
prodotto scritto sopra quello della macchina. Il muro del blocco resta assoluto
perche' un blocco e' infinito; la lentezza si misura contro la macchina.

Il pin punta al core di firefox-20, gia' sull'indice.
2026-08-17 21:59:40 +02:00
Federico d599a95a92 firefox-20: the font gate stops approving while blind, and the media test tells slow from hung (#76)
* Forget the remembered chrome window geometry before a persistent relaunch

Relaunching a persistent profile on Windows succeeded 2 times out of 8. The cause
is in juggler: awaitViewportDimensions resolves only when innerWidth and
innerHeight equal the requested values exactly, it has no timeout, and it re-runs
its check only from a resize or navigationcommitted event. On a relaunch Firefox
restores the chrome window from the profile's xulstore.json, so the corrective
resizeBy computes a null delta, no resize is emitted, and the check is never
re-evaluated. The first launch never hits it because the window starts at the
default size, far from the target.

Confirmed with one difference on the same binary and profile: keeping the
geometry gave 3/6, deleting it 6/6, and successful relaunches went from 20-155s
to 7-10s. After the fix the gate reports 6/6 at about 7s each.

Only the five geometry keys are removed, not the file: the rest of xulstore is UI
state unrelated to this defect.

This acts on the trigger, not on the origin, and says so: the origin is the
unbounded wait, which lives in engine code re-synced from upstream at every
rebase.

Two comments corrected because they asserted things the code does not do. The
first claimed Playwright writes user.js on every launch, which is false on the
Juggler path - writePreferences lives in server/bidi/ and the base
prepareUserDataDir is empty - and that false belief is what made the
first-launch/second-launch asymmetry look impossible. The second named
INVPW_BINARY_PATH in resolve_executable, which never reads it.

Not a fingerprint change, and measured rather than argued: on a reused profile a
page sees inner=[1920,947] outer=[1920,1032] and outer-inner=[0,85], identical to
the first launch and to the declared model.

* Withdraw the cause I wrote for the persistent-relaunch hang: it is false

A dump() probe inside awaitViewportDimensions, with the remedy disabled at
runtime so the defect would reappear: over 8 relaunches the 6 that worked ran
that check twice and matched exactly on the first try every time, and the 2 that
hung never reached it. So that wait never mismatches, and the stall happens
before a target exists.

What stays measured is the correlation: 12 relaunches out of 12 with the geometry
keys removed against 5 out of 14 with them kept. But a real effect does not prove
a mechanism - deleting a file also changes timing, and on a startup race a timing
perturbation improves things for the wrong reason.

So this call is a declared patch, and worse than the patch it was first written
as: then the cause seemed known and the refactor deferred; now the cause is
unknown and this removes a trigger without explaining it.

* Remove the geometry remedy: the origin was found and it lives in the core now

The cause of the persistent-relaunch hang turned out to be Windows occlusion
tracking declaring our chrome window occluded and never revoking it, and the fix
is a pref invisible_core now applies to every session. So this file goes back to
having no remedy of its own: the function, its constant, the call and its five
tests are gone.

Measured before removing them: with the pref and this code deleted, and the
persisted window geometry deliberately KEPT, 10 relaunches out of 10 succeed at
about 7 seconds each. Keeping both would leave two places knowing the same fact,
which is what rule 16 forbids.

And the note in _session.py that presented INVPW_TRUE_HEADLESS as the escape
hatch for this hang now carries the mechanism instead of the symptom: true
headless was reliable because there is no window to occlude. It stays as a
deliberate choice of a different rendering path, not as a workaround.

Full account, including the two causes I wrote before this one and how each was
falsified: 71-bug-archive.md [B150].

* The e2e strips INVISIBLE_CORE_PIN, because one of its tests asserts what that variable disables

Setting it is the normal way to drive a locally built engine, so it is usually already
exported in the shell that starts a run, and the venv subprocess that the upgrade test
spawns inherits it. That test deliberately breaks an environment and requires importing
the wrapper to repair it. With the variable set the repair correctly declines, the version
does not move, and the test fails for a reason that has nothing to do with the binary.

Measured: one failed and a hundred forty three passed in fourteen minutes, and the same
file re-run with the variable unset gave four passed in two minutes. Refusing up front
costs a second, and discovering it costs the whole run plus the time spent believing the
product was broken.

It is stripped rather than merely warned about, because a warning at the top of a
fourteen minute run has scrolled away long before the failure appears. The line that says
it was stripped prints only when it was actually set.

* La lista delle famiglie nel font gate era rimasta a 68, e la deriva dava verde

Il manifest e' passato a 71 famiglie il 16 agosto, aggiungendo le due Segoe di
icone e Twemoji Mozilla. La lista dentro scripts/ci_font_gate.py e' rimasta a
68, quindi il gate non cercava piu' tre famiglie che spediamo.

La parte che conta non e' la deriva, e' cosa produce. Misurato sul binario vero:
la sonda interroga EXPECTED piu' i nomi dell'host e nient'altro, quindi una
famiglia tolta dalla lista smette anche di essere CERCATA. Con le tre mancanti
il gate stampa "detected 68 families (expected 68)" e FONT GATE OK, uscita 0, su
una build che ne espone 71. Un gate d'accordo con se' stesso non vede la propria
deriva, e nessuna mutazione del gate l'avrebbe scoperta.

La lista resta un letterale, e non per pigrizia: il job di release.yml che
esegue questo gate fa il checkout di questo repo ma installa soltanto playwright,
quindi importare invisible_core li' uccide ogni rilascio. La derivazione e'
stata scritta e provata, funziona in locale, ed e' stata ritirata per quello. E
anche se un giorno quel job installasse il core, quando la pipeline gira il core
pubblicato e' ancora quello del rilascio precedente: si misurerebbe il binario
nuovo contro la dichiarazione vecchia.

Quindi cio' che tiene onesto il letterale e' un test, non l'attenzione di chi lo
edita, e quel test non esisteva. Era documentato come esistente, con nome e file,
e nell'albero non c'era: e' esattamente per questo che la lista ha potuto restare
indietro per un giorno. Ora c'e', e la sua mutazione e' stata eseguita: tolto un
nome diventa rosso, rimesso torna verde.

Verificato sul binario locale: 71 famiglie rilevate su 71 attese, zero fughe
dall'host, i generici mappano su font Windows.

* Il test riportava un blocco dove c'era solo una macchina carica

Con una soglia sola, una risoluzione lenta di enumerateDevices veniva riportata
come MAI RISOLTA: scriveva il verdetto del prodotto sopra quello della macchina.
Adesso i limiti sono due e i messaggi distinti.

Il muro del blocco resta assoluto a 120 secondi, perche' un blocco e' infinito e
non deve scalare con niente: sono 83 volte la mediana e 24 volte il peggior tempo
mai osservato quando la chiamata funziona. La lentezza invece si misura contro la
macchina: la pagina cronometra ventimila microtask e il limite e' un multiplo di
quel tempo, con un pavimento e un tetto sotto il muro.

Due difetti della prima stesura di questo rimedio, colti misurando e non
rileggendo. Il riferimento contava cinquanta giri di setTimeout e a macchina
scarica dava 2624 ms, cioe' cinquantadue per giro: non era carico, era il clamp
dei timer, che Firefox applica comunque. Un riferimento va scelto per cio' che
misura, e un timer clampato misura il clamp. E da quel numero il limite di
lentezza usciva sopra il muro del blocco, quindi la prima asserzione scattava
sempre prima e la seconda era irraggiungibile: un'asserzione morta che sembrava
una protezione. Da li' il tetto.

Entrambi gli input noto-cattivi eseguiti: muro a un millisecondo fa scattare il
messaggio del blocco, pavimento e multiplo a uno quello della lentezza.

* Il messaggio del gate andava in errore proprio quando serviva

Il messaggio dell'asserzione usava un % dopo una concatenazione con +, quindi
quel % si legava solo all'ultimo gruppo di letterali adiacenti, che non ha
segnaposti, e alzava TypeError. Un messaggio di asserzione viene valutato solo
quando l'asserzione fallisce, percio' il difetto si manifestava esattamente
nell'istante in cui serviva la spiegazione: in CI e' comparso un TypeError al
posto della differenza fra le due liste.

Ora i valori si concatenano gia' resi con repr, che non ha questo modo di
sbagliare, e il messaggio dice anche cosa guardare se scatta durante un
rilascio: la CI installa il core PUBBLICATO, non quello dell'albero, quindi un
gate aggiornato prima che il core sia sull'indice vede il manifest vecchio.

Cercato lo stesso schema negli altri quattro file di test toccati oggi: nessuna
altra occorrenza.

* Il pin punta al core di firefox-20

invisible_core 20.14.0 e' sull'indice, quindi la condizione che il workflow di
pubblicazione pretende e' soddisfatta: il pin esatto risponde 200 prima che il
rilascio parta.

Il numero non e' scritto a mano da nessuna parte. La versione del core e'
derivata dal suo sigillo, e sync_core_pin la legge da li' e la porta qui, cosi'
non esiste un punto in cui qualcuno possa dimenticarsi di alzarla.
2026-08-17 21:38:47 +02:00
Federico b16b9c9438 Ask for a Telegram handle instead of an email in the scrape panel (#75) 2026-08-17 05:13:29 +02:00
Federico 5aa8c68b4e Refine the scrape panel: higher contrast, clearer fields, a gradient CTA (#74) 2026-08-17 03:00:00 +02:00
Federico 049476ad43 Drop the empty-state search hint under the search bar (#73) 2026-08-17 02:45:14 +02:00
Federico 9e650968f6 Replace the scrape chat with a single smart instruction panel (#72) 2026-08-17 02:34:53 +02:00
Federico f3814b6bb1 Replace the Telegram handoff with an in-page scrape chat (#71) 2026-08-17 02:15:34 +02:00
Federico 0dd6dd2a38 Rework the demo: click dissolves the scene into the scraped products.json (#70) 2026-08-17 01:45:14 +02:00
Federico 429798f70e Smooth the ScrapeOrbit demo to 25fps for less mechanical motion (#69) 2026-08-16 23:04:33 +02:00
Federico d486660604 Trim the ScrapeOrbit banner to the demo and one call to action (#68) 2026-08-16 22:01:21 +02:00
Federico b9f35c0bcb Animate the ScrapeOrbit banner and switch on global company search (#67)
Swap the static banner for a short looping demo (type a company, get the
real result with its logo, hit Scrape) and add a badge row under it. Set
the Brandfetch client id so the search covers every company, not only the
bundled index.
2026-08-16 21:20:14 +02:00
Federico 5fef7cc316 Add ScrapeOrbit landing page and point the README banner to it (#66)
New static page under docs/ served at the site root: a company search with logos and a scrape button that opens a direct chat. The top of the README now shows the ScrapeOrbit banner linking to it, in place of the group link.
2026-08-16 19:44:25 +02:00
Federico 7278427aa8 I test dell'installazione ereditavano l'ambiente di chi li lanciava (#65)
env=None in subprocess.run non vuol dire ambiente vuoto: vuol dire eredita.
Quindi PYTHONPATH e INVISIBLE_SEAL_FILE entravano nei venv che questi test
costruiscono, e il venv importava il core del banco invece di quello installato
o cercava un sigillo locale. Sedici rossi in un giorno, nessuno del prodotto.

Il verso pericoloso e' l'altro e resta il motivo per cui vale la pena: questi
due file sono l'unica cosa che verifica cosa riceve un utente, e un verde che
arriva da un ambiente che nessun utente ha non dimostra niente.

Adesso il default e' l'ambiente ripulito, e il messaggio di errore dice cosa ha
tolto: una variabile rimossa in silenzio e' lo stesso difetto di una ereditata
in silenzio, col segno cambiato. Ripulite anche le due subprocess.run dirette,
cosi' non resta un'eccezione da ricordare.

La duplicazione fra i due file resta, ed e' voluta: un modulo condiviso qui
sarebbe un errore di raccolta sul runner, che ha solo pytest. A tenere allineate
le due copie c'e' un test che le confronta fra loro, insieme al controllo che
riproduce il mondo di prima - con env=None la variabile deve passare, altrimenti
a essere rotto e' il banco e non il rimedio.
2026-08-14 11:25:48 +02:00
Federico f777798a7c Il ripiego del ledger non ha mai girato, e i tag non avevano release page (#64)
Due difetti nello stesso job, tutti e due misurati oggi.

Il primo: quando la protezione rifiuta il push su main, il passo dovrebbe
mettere la voce su un ramo e aprire una PR. Non e' mai successo. Da HEAD
staccato, `HEAD:ledger/1.2.3` non e' risolvibile - il ramo non esiste ancora e
la sorgente e' un commit, quindi git non sa se gli si chiede un ramo o un tag e
rifiuta con "not a full refname". Sotto bash -e il passo muore li', quindi la PR
non veniva nemmeno tentata e nessuna delle due annotazioni veniva stampata. E'
per questo che non e' mai esistito un ramo ledger/* su nessuno dei tre, in
quattro corse rosse su release che erano invece andate a buon fine.

Il secondo: creare la PR richiede anche l'impostazione "Allow GitHub Actions to
create and approve pull requests", che e' spenta su tutti e tre. Il
pull-requests: write del job serve ma non basta. Quindi la PR ora e' best
effort: appena il ramo e' spinto la voce e' salva, e il run non diventa rosso
per una comodita' che un'impostazione puo' togliere. Rosso solo se la voce si
perde davvero, che e' quello che il commento diceva gia' e il codice no.

E la release page: dopo tre tag, quattro versioni su quattro non ce l'avevano, e
le ha trovate un gate DOPO la pubblicazione. Ora la crea il workflow dal tag,
con il corpo preso dal CHANGELOG dove c'e' e generato dove non c'e'. Idempotente:
un tag rispinto o una pagina fatta a mano sono un no-op, non un rosso.

Eseguiti tutti i rami di entrambi i passi contro un remoto che rifiuta il ramo
di default come fa la protezione: push accettato, rifiutato con PR creata,
rifiutato con PR vietata da 403, tutto rifiutato. Il codice vecchio, sullo stesso
banco, riproduce parola per parola l'errore del log di produzione.
2026-08-14 04:24:04 +02:00
Federico 63752e12ec Il badge delle stelle non lo ricalcolava nessuno dal 19 luglio (#63)
Era stato disegnato a mano quando ho tolto shields.io e da allora nessuno
script lo toccava piu': diceva 1.8k con 1886 stelle vere, cioe' mancavano
14 stelle perche' diventasse semplicemente falso sulla prima pagina.

Ora lo genera lo stesso renderer del badge dei lanci, dallo snapshot
giornaliero, e legge dal ramo badges come l'altro. Il ramo serve perche' main
richiede il check gate e un commit diretto dell'API viene rifiutato con 409.
2026-08-14 03:18:27 +02:00
Federico 88e955afe5 Il badge dei lanci si pubblicava su un branch protetto (#62)
Il README mostrava 1,64M mentre il numero vero e' 1,78M. Il badge viene
aggiornato ogni giorno da un'attivita' pianificata che usa l'API dei contenuti,
cioe' fa un commit diretto su main; da quando main richiede il contesto `gate`
con enforce_admins quella chiamata fallisce con

  HTTP 409 - Could not update file: Required status check "gate" is expected.

Il difetto era invisibile perche' la stessa attivita' salva anche il CSV dei
download, e quella parte continuava a funzionare: si vedeva solo come esito 1
nell'Utilita' di pianificazione, e come un badge fermo su un numero vecchio.

Un'automazione non puo' aprire una PR e aspettarne il merge, quindi il badge
adesso vive sul branch `badges`, che non e' protetto. Verificato end to end: la
pubblicazione riesce e l'attivita' esce 0.

Effetto collaterale desiderabile: main non riceve piu' un commit al giorno per un
file che nessuno legge nella storia.
2026-08-14 02:49:12 +02:00
Federico bd6a5f7960 Su Windows GitHub usa PowerShell: shell bash sul job di caccia (#61)
Il primo lancio della caccia su windows-latest e' morto in cinque minuti con un
ParserError di PowerShell sulla riga `if [ "$RUNNER_OS" = "Linux" ]`. GitHub
esegue i blocchi `run:` con pwsh sui runner Windows, non con bash.

La cosa da ricordare non e' il difetto, e' che la verifica non lo aveva visto.
La regola dice di estrarre ogni blocco `run:` dallo YAML ed ESEGUIRLO, e l'avevo
fatto: due giri verdi escono 0, un impiccamento simulato si ferma ed esce 1. Ma
l'avevo eseguito in bash sulla macchina di chi scriveva, cioe' con un interprete
diverso da quello del bersaglio. Eseguire il blocco non basta se lo si esegue con
la shell sbagliata.

`defaults: run: shell: bash` sul job, cosi' entrambi i bracci usano lo stesso
interprete e i blocchi restano quelli gia' provati.
2026-08-13 20:21:43 +02:00
Federico c651f8e286 Il banco di caccia sceglie il sistema operativo (#60)
Sulla macchina di sviluppo i test di interazione producono ritentativi (41 su 17
giri) mentre su Linux non ce n'e' nemmeno uno in 36. Sembrava un difetto di
piattaforma, ma quel confronto e' CONFUSO: i giri Linux stavano su runner
dedicati, quelli Windows su una macchina dove prima girava la suite di chi
misurava e poi e' tornato il proprietario col suo lavoro. Il primo giro
"pulito" e' uscito con 25 processi estranei contro un riferimento di 10.

Un runner Windows dedicato separa piattaforma da contesa senza chiedere a
nessuno di stare fermo sei ore. firefox-launch-matrix.yml dimostra da mesi che
il browser parte sui runner Windows, quindi la strada esiste gia'.

Tre cose per farlo funzionare su entrambi: xvfb condizionato a runner.os ==
'Linux'; le prove sotto prove/ nello spazio di lavoro invece che in RUNNER_TEMP,
che su Windows contiene backslash e non attraversa bash in modo affidabile; e il
prefisso del comando in una variabile, vuota fuori da Linux.

Eseguito, non riletto: il ramo per sistema da xvfb-run su Linux e vuoto su
Windows, e il ciclo intero gira su quel braccio in entrambi gli esiti - due giri
verdi escono 0 con l'avviso, un impiccamento simulato al secondo giro si ferma,
esce 1 e stampa l'ultimo test piu' lo stack.
2026-08-13 19:48:33 +02:00
Federico 1d841b295c Il README non consiglia piu nessun provider di proxy (#59)
Escono le due raccomandazioni sponsorizzate: il blockquote sotto "Still
seeing captchas or anti-bot?" e il paragrafo in coda alla sezione Proxies.
Quello che resta sulle sezioni e' la spiegazione del problema, senza un
nome da cliccare.
2026-08-13 17:11:13 +02:00
Federico 7b912f6729 Il test della sessione lunga riceve la sua scadenza (#58)
Misurato sullo stesso commit: 4,3 secondi su Linux in CI e oltre 300 su Windows,
mentre l'intera suite su Windows e' solo 3 volte piu' lenta. E' il difetto aperto del
layout che non mette in cache i font fra documenti.

Con la globale a 420s una macchina piu' carica lo ucciderebbe, e un test legittimo
ucciso dalla protezione produce un rosso identico all'impiccamento che la protezione
cerca. Il marcatore si toglie quando il difetto si chiude.
2026-08-13 16:48:13 +02:00
Federico 61a15f9d69 Strumenti per debuggare l'impiccamento dell'e2e dove succede, su CI (#57)
Il difetto vive su Linux sotto xvfb e si presenta nel 12% delle corse, quindi gli
strumenti stanno su CI: una caccia sulla macchina di sviluppo gira su Windows e un
negativo li' non direbbe niente di questo ambiente.

Un cane da guardia che a 150s dentro un test scrive lo stack di ogni thread su FILE
(pytest redirige i descrittori a livello di sistema, quindi stderr si perde quando il
processo viene ucciso), l'artifact che lo porta fuori, un passo che dimostra che era
armato, e e2e-hunt.yml che cicla la suite fino a catturare.

Ogni blocco run: e' stato estratto dallo YAML ed eseguito in tutti gli esiti. Cosi' e'
venuto fuori che il controllo del cane da guardia moriva su ogni corsa VERDE, perche'
grep -c che conta zero esce 1 sotto bash -e.
2026-08-13 13:02:18 +02:00
Federico 2770891acd Una scadenza non e' un flake, e va presa con un thread (#56)
Causa dell'impiccamento del job e2e a 40 minuti, due volte. --only-rerun conteneva
`Timeout`, scritto per il TimeoutError di Playwright, e cattura anche
subprocess.TimeoutExpired: misurato, due test producono 4 rerun. I test di
release/upgrade vivono dentro pip install con timeout fino a 300s, quindi uno che
scade costa 900 secondi; la somma dei loro timeout e' 10.050 s, ritentati 30.150,
contro un tetto di 2.400.

Due --rerun-except (TimeoutExpired, `Timeout >`) piu' --timeout 420. Il metodo e'
thread e non il segnale predefinito: misurato, il segnale NON interrompe questo
blocco, perche' l'API sincrona di Playwright attende sul socket del driver e il
gestore non trova mai un confine di bytecode. Validato contro un socket in accept()
che nessuno connette: col thread il test e' nominato e lo stack indica la riga.
2026-08-13 03:34:25 +02:00
Federico 707720b691 L'e2e nomina il test su cui si pianta, e non parte su PR di sola documentazione (#55)
Due impiccamenti, il 4 e il 12 agosto: job ucciso dal timeout di 40 minuti contro
una durata normale di 4:47. Sullo stesso commit il tentativo 2 e' verde in 5, quindi
e' intermittente e non dipende da cio' che si spedisce.

Il log non diceva su quale test, e non era il buffering: PYTHONUNBUFFERED e python -u
c'erano gia' ed entrambe le corse hanno stampato la stessa riga al 50% a 78 secondi.
Era la granularita' di -q, un carattere per test su righe da 72. Con -v sono 144 righe
nominate, verificato sul run di questa PR.

E paths-ignore era su push e non su pull_request, per questo la #54 di sola
documentazione ha bruciato i 40 minuti interi.
2026-08-13 02:49:53 +02:00
Federico 33cebafd84 Via il sito Pages: la wiki e' la superficie che ranka (#54)
Il sito su github.io e' stato eliminato. Sui 313 articoli Google aveva 262 pagine
dalla wiki e 30 da Pages, e le due copie portavano lo stesso testo (95-96% di
sovrapposizione), quindi competevano sulle stesse query.

Se ne vanno il workflow di deploy, la configurazione Jekyll, il file di verifica di
Search Console e i breadcrumb JSON-LD che puntavano a URL ora inesistenti. docs/
resta: e' la sorgente da cui publish-wiki.yml genera la wiki.
2026-08-13 02:30:07 +02:00
feder-cr 93a2df7612 One aggregating gate job, and skipped is not failed
Branch protection here required four contexts, and one of them -
`pytest (windows-latest, py3.11)` - is EXCLUDED by the matrix a few lines
above where it is declared. A required context that no job can produce means
the protection could never be satisfied; with enforce_admins false every push
went through regardless and nobody noticed. Measured 2026-08-13, same shape in
the core and the manager.

A list of matrix names drifts every time the matrix changes, which is exactly
how this happened. This job depends on the whole matrix and its name never
changes.

The part specific to this repo: `unit` is deliberately SKIPPED when
core-on-index reports the pin is not on the index yet - during that window no
install can succeed, and the workflow chose to skip rather than fake green. A
gate demanding `success` would turn that choice into a red on release day, and
the first reaction would be to remove the protection. So it refuses on
`failure` and `cancelled`, never on `skipped`.

The `run:` block was executed against every outcome before pushing.
2026-08-13 01:11:51 +02:00
feder-cr 01d692be2a badge: browser launches at 1.64M 2026-08-12 09:00:06 +02:00
feder-cr 8180b624f1 README: say what the project is in the words people search for
The opening described the project in our own vocabulary. Keyword research put
real numbers on that: headless browser and playwright headless are the terms
with both volume and a reachable SERP, captcha bypass carries most of the
captcha demand, and the project name itself has none. Reword the hook, the
tagline and the two questions to lead with those, naming the challenges people
actually meet. Only the top of the file moves - Google attributes roughly the
first thirty lines to the repo home and the rest to the README blob, so this is
where the words count.
2026-08-12 07:55:40 +02:00
feder-cr 22b53847f0 CHANGELOG: 0.7.0
The gate caught it, not a person: test_the_changelog_documents_every_version
_it_claims_to_cover reads what the index serves and refuses a published
version the file does not mention.
2026-08-11 18:14:39 +02:00
feder-cr 5e5d0f516d Back-fill the 0.7.0 ledger entry the publish run could not commit
Third time today across the three repos, same cause: the upload succeeds,
branch protection declines the workflow's ledger commit, the run reports
failure for a release that shipped. Verified with check --verify-index,
which answers exit 5 - byte-identical to what the index serves.
2026-08-11 18:00:29 +02:00
feder-cr 5ed8dd6ba2 The core pin follows the seal to 19.14.0
firefox-19 is public, the core rolled its seal onto it, and the pin moves
with it. Written by scripts/sync_core_pin.py rather than by hand, which is
what keeps the two spellings - invisible_core== in the file, the hyphenated
one in every comment about it - from drifting into a gate that greps for
the wrong one.
2026-08-11 17:35:21 +02:00
feder-cr 7ca67819c6 The font gate asked a question whose answer could not mean anything
Two defects, one cause. It launched the binary raw, and it inferred "did
this face load" from a number we declare ourselves.

The raw launch used to be fine and stopped being fine when the generic
family map moved out of compiled C++ and into a declaration. An engine
without its declarations does not invent them, by design, so the gate was
measuring engine rule 7 working and calling it a defect. Measured on one
binary: raw on Linux, serif, sans-serif, monospace, cursive and fantasy
all collapse onto Arial and Arial disappears from the family list. The gate
now hands in that one declaration - zoom.stealth.fonts.generics, constant
across seeds - and the generics map to Times New Roman, Arial, Consolas and
Comic Sans on both platforms. It is a copy, and it is the only copy in the
project, so a test binds it to what the core produces and goes red if they
separate.

The .ttc check was unanswerable rather than wrong. It asked "does this
family measure differently from NO font", and the no-font face is itself
one of the bundled families: Microsoft YaHei IS the CJK fallback, proven
at the pixel level. YaHei therefore failed its own check, and so did
MingLiU-ExtB and PMingLiU-ExtB, whose cmaps cover none of the probe
characters - falling back is correct there, read from the font files. It
passed for a year on a coincidence: the fallback's line height was 91 and
theirs 95. Line heights are declared now, the fallback landed on 95, and
the coincidence ended.

What replaces it is structural. Group the families by their measureText
ink box and assert WHICH families share a face, not what the numbers are.
A face that fails to load falls into the fallback group and the grouping
changes, which is the failure the check exists for. The numbers themselves
are deliberately not asserted here: raw on Linux they come back as
FreeType's grid-fitted integers while Windows returns fractions, and they
only agree once the browser has all its declarations - so cross-OS value
parity belongs in a check that runs under the wrapper, not in this one.

Green on three binaries launched exactly the way CI launches them: this
build on Windows, this build on Linux, and the released firefox-18 Linux
asset as a known-good reference. Validated by moving one family between
groups, which turns it red and names both sides of the move. One mutation
SURVIVED and is written into the file rather than hidden: deleting a name
from EXPECTED also deletes it from what gets probed, because a page cannot
enumerate system fonts, only ask name by name.
2026-08-11 12:31:14 +02:00
feder-cr 28b6a2ccd7 Two e2e tests for failures the suite could not see
A session that dies under heavy text shaping, and a frame that reports
its parent's screen origin instead of its own. Neither was reachable by
the existing e2e tests: they open a page, assert one thing and close, so
none of them shapes enough text or lives long enough, and none looks at
geometry from inside a nested frame.

Both were validated by reintroducing the real defect in the engine and
rebuilding, not by reasoning about them. The frame test fails with
"the iframe reports mozInnerScreen (0, 235) instead of (220, 235)" and
only on the axis that was broken, which is what says it measures the
right thing.

The long-session test reads its font families from the profile manifest
rather than a list written here, so a change to the bundle moves the
test with it. Its navigation timeout is large on purpose: this engine
reloads the declared faces on every document, so 30s is a coin flip
rather than a margin, and a timeout would report a dead session for a
browser that was only busy.
2026-08-11 12:15:42 +02:00
feder-cr 5c1e5fdb88 0.7.0: the core pin moves, and one public signature changed
Minor rather than patch, because seed_recaptcha_cookies_sync, its async twin and
build_cookies now take locale= where they took timezone=. Anyone calling them by
keyword has to move, and that is what the bump is for.

The pin goes to invisible_core==18.14.0, which carries the fix for the pref that
killed a second browser context on Windows. A consumer whose pin moved has
changed and has to be published, or it pins a core its users cannot resolve.
2026-08-11 12:15:42 +02:00
feder-cr 98788cbf4a A shipped doc described navigator.buildID as doing the opposite of what it does
The page said "the property returns whatever the binary was actually compiled
from", and built an argument on it. Measured by reading the property from a page
on the real binary: it returns 20181001000000, the fixed constant every release
Firefox reports. Gecko flattens it in Navigator.cpp for any non-system caller
outside a mozilla.org origin - not gated on resistFingerprinting, not gated on
any profile pref.

The correction matters in the direction it was wrong: the doc described this
build as carrying a value nobody else carries, when what it actually does is the
same thing every Firefox does. That is the stronger position and the one the
rest of the page argues for.

Also here: the `or "en-US"` at the CONSENT call site is gone. consent_region_lang
has that fallback in its own body, so pre-empting it meant the core never saw a
falsy locale and its decision never ran - a second place deciding the same fact,
in the same file where a 22-row timezone table was deleted for the same reason
hours earlier.
2026-08-11 12:15:42 +02:00
feder-cr 46c4e43e54 Delete the timezone table the CONSENT cookie used, and derive from the locale
_TZ_TO_REGION mapped 22 IANA zones to a country and a language for the Google
CONSENT cookie. The session locale is resolved in invisible-core from the
egress country against 55 countries. Two tables for one fact, in two
repositories, and they drifted the way two tables do: a Romanian session
reported ro-RO as navigator.language and en+FX in the cookie, because
Europe/Bucharest was not one of the 22. A page that reads both sees a Romanian
browser claiming to be a non-EU English one.

Deleting beats extending here. Deriving from the locale covers every locale the
core can resolve, including the countries nobody has added to a list yet, and
the only finite part left - which countries get their own token rather than FX
- lives in the core as one set.

The old rows still give the same answer (it-IT, de-DE, en-GB, ja-JP). One
deliberate difference: Norway moves from "no" to "nb", because the locale we
declare is nb-NO and the coherence worth having is with our own language.

The new test pins Romania, which is the case the old table got wrong.
Mutation-tested: shrinking the country set to the three the old table really
covered fails exactly that case.

Needs invisible-core on the index first: consent_region_lang is a new name.
2026-08-11 12:15:42 +02:00
feder-cr 2f5f6c7869 Read the window chrome from the profile, and stop asserting the invented value
_CHROME_W = 14 and _CHROME_H = 91 were module constants here. Stock Firefox
151 answers 0 and 85 to the same two subtractions. The declaration lives in
invisible-core now, as Profile.screen.chrome_w / chrome_h, and both viewport
sites read the profile rather than the module.

The test is the part worth reading. test_chrome_offsets_are_positive_ints
asserted _CHROME_W > 0, reasoning that "any zero/negative value would let
viewport bleed past screen bounds". That is false - a viewport exactly as wide
as the screen is inside the bounds, not past them - and the false reasoning is
what kept the invented number alive through every run. It now asserts the
invariant that sentence was reaching for, on a real profile, and lets the
horizontal chrome be zero.

Needs invisible-core on the index first: CHROME_W and CHROME_H are new names
there.
2026-08-11 12:15:42 +02:00
feder-cr d3b514cf4b The font manifest travels as an env var, and the CI list had gone stale
Two leftovers from the manifest handover, committed together because they
are the same change seen from both ends.

build_env carries the manifest. The engine builds its font list during app
startup, inside InitSharedFontListForPlatform, and on this path the prefs
have not reached the profile yet - Playwright sends them over the
connection after the process is up, so a pref cannot work here no matter
how early it is written. The manifest goes as STEALTHFOX_FONT_MANIFEST
pointing at a content-addressed file, verified against the engine's own
face files first, because metrics for a font that is not there are worse
than no metrics.

The CI list had gone stale in the direction that matters. It still named
Arial Black, Franklin Gothic Medium, Segoe Fluent Icons and Segoe MDL2
Assets, which came out of the bundle on 2026-08-07 because a real Windows
Firefox does not expose them as family names to a page - measured against
the retail install with a throwaway profile. 68 now, not 72. It is a
hand-kept copy of the manifest's F| records, the docs already call that a
drift risk, and it was an audit that caught it rather than the gate.
2026-08-11 12:15:42 +02:00
feder-cr d784dbbfba The taskbar was a fourth constant here, at 40, while everyone else said 48
launcher.py carried _TASKBAR_H = 40. invisible_core.constants said 48 and
the engine's compiled floor in nsScreen.cpp said 48, so the default
viewport was derived from one number and screen.availHeight from another.
A page reads both off the same window.

Both use sites now take p.screen.taskbar_px, which is a profile field and
pinnable like anything else. _TASKBAR_H survives only as an alias of the
core's name, because async_api and two tests import it - it resolves to
the same declaration instead of competing with it.

The old test asserted the viewport against _TASKBAR_H, which by
construction could not see any of this: it passed with 40 and with 48
alike. It now asserts against the profile field, and a second test pins
72 and requires the viewport to follow. Mutation-proved - putting
_TASKBAR_H back in the expression fails the pinned case.

Needs invisible-core with TASKBAR_PX on the index before release.
2026-08-11 12:15:41 +02:00
feder-cr c813380366 Six knobs that existed and were documented nowhere
The voices, the fake media devices, the storage booleans, the generic-family
table, the accessibility overrides and the taskbar height all became Profile
fields today and stopped there. An undocumented knob is one nobody uses, and it
gets deleted by whoever next reads the code as dead.
2026-08-11 12:15:41 +02:00
feder-cr 72fb16d728 Nine knobs that existed and were documented nowhere
The screen colour depth, maxTouchPoints and the seven rasterisation parameters
became Profile fields yesterday and stopped there: not in the pin table, not on
this page, so they could be neither pinned nor found. An undocumented knob is
one nobody uses, and it gets deleted by whoever next reads the code as dead.

The test that says so was already written and was already failing.
2026-08-11 12:15:41 +02:00
feder-cr 7361ed08a2 docs: title these pages the way people search for them
The titles led with the project name, which nobody searches for, and left out
the phrase they do type. Keyword research on autocomplete and related searches
put 'playwright stealth' at over a thousand demand points and the project name
at zero. Lead with the subject instead, on the fourteen pages where the gap was
widest. Only the title and H1 move; slugs, URLs and content are untouched.
2026-08-11 12:15:41 +02:00
feder-cr c6c45cd8ff badge: browser launches at 1.56M 2026-08-11 09:00:06 +02:00
feder-cr 06096159b0 badge: browser launches at 1.48M 2026-08-10 09:00:07 +02:00
feder-cr b6c74fca67 badge: browser launches at 1.41M 2026-08-09 09:00:06 +02:00
feder-cr 14050be60b badge: browser launches at 1.34M 2026-08-08 09:00:06 +02:00
feder-cr a5f3356f94 security: serve the detector bundle from a preloaded map, not a built path
The is_relative_to containment check did not satisfy CodeQL's path-injection
query - the tainted request name still flowed into a filesystem path. Preload
the vendored files into a name->bytes dict at server start and serve by exact
key, so no path is ever constructed from the request. Same behaviour, and no
path for a crafted request to traverse.
2026-08-07 12:34:54 +02:00
feder-cr 07a931c3e3 security: clear the six CodeQL findings on main
- firefox-launch-matrix.yml declared no permissions, so its token
  defaulted wide. Add an explicit least-privilege block (contents: read).
- test_webrtc_realness sdp IP regex used (?:\d|\w)+ and (?:\d|\w|.|:)+ -
  overlapping alternatives that backtrack. Same character sets as \w+ and
  [\w.:]+, which match linearly. Behaviour is identical (v4, v6, mDNS).
- test_detectors_e2e's local vendor server built a path from the request.
  .name already dropped any directory part; make containment explicit with
  an is_relative_to check so the path provably cannot escape the vendor dir.
2026-08-07 12:28:24 +02:00
feder-cr e3219d9271 badge: browser launches at 1.29M 2026-08-07 09:00:07 +02:00
feder-cr d55bc06e68 docs: add Search Console verification file for the Pages site
Google Search Console URL-prefix verification token for
https://feder-cr.github.io/invisible_playwright/ - a public verification
handle, not a secret. Served as a static file by Jekyll.
2026-08-07 04:16:07 +02:00
feder-cr 062fea1d0a ci: trim the heaviest matrices to stop saturating the runner queue
A burst of pushes was queuing more jobs than the account can run at once,
so runs sat pending and got cancelled. Cut the redundant load:
- tests runs the full Python range on ubuntu but only 3.12 on Windows
  (8 jobs down to 5; the scarce Windows runners drop from 4 to 1). This is
  a pure-Python package, so the OS matrix does not need every version twice.
- firefox-launch-matrix, a firefox.exe-launches smoke test, runs one Python
  across the three Windows versions instead of three (9 jobs down to 3).
- user-install moves from a daily to a weekly cron.
No test coverage of behaviour is dropped; only duplicate OS/Python cells are.
2026-08-06 22:22:44 +02:00
feder-cr 0e026eb7f5 ci: cancel superseded tests/e2e runs cleanly with a concurrency group
A burst of pushes left older tests and e2e runs with their queued jobs
cancelled one at a time, which marked the whole run failed even though no
test had failed. Give each workflow a concurrency group keyed by workflow
and ref so a newer push cancels the older in-flight run as a unit; tests
and e2e keep separate groups so they never cancel each other.
2026-08-06 21:34:36 +02:00
feder-cr 0fea48789e ci: build and deploy Pages via Actions instead of the legacy branch builder
The legacy Pages builder started hanging in the building state for this
repo and never finished, so every deploy timed out while the site stayed
on an older build. The Jekyll build itself is fine, so this builds the
docs/ site in Actions and publishes the artifact directly, and Pages is
switched to the workflow build source.
2026-08-06 19:47:24 +02:00
feder-cr e61a60d9ee docs: a playbook pass over the final block of articles
Last block of the review (articles 201-301 alphabetically), completing a
full pass over the site: tightened each section's opening answer, kept the
FAQ and see-also blocks, and linked the primary source (Playwright docs,
MDN, a spec, or the relevant RFC) where a claim rests on one. Eleven pages
were already in good shape and were left untouched. No claim was changed.
2026-08-06 16:10:11 +02:00
feder-cr 6d21f5ffe8 docs: a playbook pass over the next 100 articles
Second block of the review (articles 101-200 alphabetically): tightened
the opening answer of each section, kept the FAQ and see-also blocks in
place, and linked the primary source (Playwright docs, MDN, a spec, the
relevant RFC, or the Python docs) where a claim rests on one. Nine pages
were already in good shape and were left untouched. No claim was changed.
2026-08-06 15:01:35 +02:00
feder-cr 532dd36a79 docs: a playbook pass over the first 100 articles
Went through the first hundred articles against the site's writing guide:
tightened the opening answer of each section so it reads on its own,
made sure the FAQ block and a see-also line are present, and linked the
primary source (MDN, a spec, the relevant RFC, or Playwright's docs)
where a claim rests on one. Eight pages were already in good shape and
were left untouched. No technical claim was changed.
2026-08-06 10:37:47 +02:00
feder-cr 5499a17fcf docs: cite the primary source next to API and protocol claims
Pages that describe a specific web API, spec, or network protocol now
link the authoritative reference (MDN, the WHATWG/W3C spec, the relevant
RFC, or Playwright's docs) inline at the first mention of the claim.
Pages resting on our own measurements are left as they are - no citation
was added where there is no external source behind the statement.
2026-08-06 10:00:16 +02:00
feder-cr d1c2a0fc56 docs: trim the over-long meta descriptions to a length that shows in full
72 pages had a description past ~175 characters, which search engines cut
off mid-sentence in the result snippet. Shorten each to about 150-160,
keyword first, keeping the same meaning. Only the description front matter
changes; titles and bodies are untouched.
2026-08-06 09:48:24 +02:00
feder-cr f2cd7e5424 badge: browser launches at 1.25M 2026-08-06 09:00:07 +02:00
feder-cr dcf56a9b41 guides: turn the category pages into real hubs that link their sections
Each guide landing page listed its topic but linked almost none of the
pages under it, so most articles had no internal link pointing in. Give
every category page a grouped, glossed index of the pages it covers, so a
reader on the hub can reach each one and each page gets an inbound link
from its section. No article bodies change, only the ten landing pages.
2026-08-06 04:01:28 +02:00
feder-cr 62c5649f99 pinning: write the storage-quota formula in ASCII
The quota row showed 1024 with a Unicode superscript two; render it as
1024**2 so the docs page stays plain ASCII like the rest of the table.
2026-08-06 03:37:34 +02:00
feder-cr 489d4f44b3 the wiki converter reads subdirectories, and the links into them
docs/ grew an integrations/ directory with nine pages. The converter listed
only the flat level, so all nine were missing from the wiki AND every link into
them pointed at a page that did not exist: nine dead links across eight pages,
invisible because the pages carrying them rendered perfectly.

A wiki has no directories, so a subdirectory page takes its own slug and a
directory's index takes the directory's name, which is also what a ](dir/) link
needs to land on. Two pages wanting the same flat name is now a refusal rather
than one silently overwriting the other; the case was run and it refuses.

324 pages out, zero unresolved links, against 315 and nine before.
2026-08-06 03:23:01 +02:00
feder-cr 3fcea64f9f document the download deadline, with the number checked against the seal
INVISIBLE_DOWNLOAD_DEADLINE shipped in invisible-core 18.13.0 and appeared in
no user-facing page, so the one way out of a slow-link refusal was reading the
source. The first draft of this section said the engine is about 110 MB and
that the default covers 60 KB/s; the seal says 217 to 238 MB depending on
platform, and the installation page has said ~238 MB all along. A figure that
contradicts the page next to it is worse than no figure.
2026-08-06 03:14:20 +02:00
feder-cr b70947992f the ledger goes to a pull request when protection declines the push
Every publish run on all three repos ended in failure yesterday, on releases
that had already shipped, at the step committing PUBLISHED.json back to main.
It is not a misconfiguration: the required contexts are correct and the matrix
produces them. It is inherent. A required status check cannot have passed on a
commit that does not exist yet, and this token has no bypass where a maintainer
push does, so the direct push can never succeed while main requires checks.

Adding a long-lived PAT would put a credential back into the one job holding
the OIDC one, which is what trusted publishing was adopted to remove. So the
push is tried, and when declined the entry goes to a ledger/<version> branch
and a pull request. Green when the entry is preserved, red only when it is
lost: a red run on a release that shipped is the misreading this replaces.

All three branches were executed, not read: a bare remote with a pre-receive
hook declining refs/heads/main and a stubbed curl. Push succeeds -> notice,
exit 0, no branch. Push declined, PR opens -> error annotation naming the
branch, exit 0. PR also fails -> exit 1.
2026-08-06 02:31:47 +02:00
feder-cr c53f15d9ec docs: SEO/GEO optimization pass over the final 58 older pages
Completes the answer-first optimization pass across the remaining older pages (meta descriptions in range, direct self-contained answers per section, comparison tables where apt, and - applying the methodology's cite-your-sources lever - descriptive-anchor internal links plus a handful of authoritative external citations to RFCs, MDN, the WHATWG DOM spec, Khronos and Playwright's own docs). Conservative: no fabrication, technical claims and honest caveats preserved, no keyword stuffing, one internal symbol and any residual pool detail generalised. With this, every existing page has now had the pass or was written to the methodology.
2026-08-06 01:33:12 +02:00
feder-cr 682983f393 docs: SEO/GEO optimization pass over 120 more existing pages
Extends the answer-first optimization pass (tightened meta descriptions, direct self-contained answers per section, comparison tables where apt, descriptive-anchor internal links) across 120 more of the older pages. Conservative: no new factual claims invented, technical claims and honest caveats preserved, no keyword stuffing, and a couple of pre-existing internal-detail mentions were generalised. The remaining older pages were left for a later pass.
2026-08-06 00:13:14 +02:00
feder-cr fa6cd61648 docs: 55 more guides - AI agents, Playwright APIs, detection surfaces, proxies, comparisons
Adds an AI-agent cluster (computer-use vs DOM agents, MCP browser server, per-seed reproducible and parallel agent identities, the agent timing signal, running headless on a server, persistent sessions, and honest fit notes for smolagents/Stagehand), a Playwright API set (page.route interception and mocking, HAR record/replay, tracing, video, storage_state, cookies, geolocation/permissions per context, http_credentials, context isolation, drag_to, resource blocking, waiting on a response), detection-surface explainers (WebGPU, color-gamut/HDR, Battery, Network Information, Gamepad, sensors, keystroke and mouse-dynamics biometrics, scrollbar width, storage quota), network/proxy topics (residential vs datacenter vs mobile, sticky vs rotating, DNS/DoH leaks, HTTP/3 QUIC, ASN reputation, IPv6, proxy chaining), and comparisons/migrations (Selenium and Puppeteer to Playwright, HTTP client vs browser, and several open-source tools). Every page answers honestly with a real usage example and the caveat that a real-looking browser does not fix IP, quotas, rate limits or behaviour.
2026-08-05 23:44:12 +02:00
feder-cr 48c47a1083 docs: an SEO and GEO pass over ten of the most-linked pages
Applies the answer-first structure across ten pillar and high-intent pages: tightens each meta description into the snippet range, front-loads a direct self-contained answer in the intro and per section (so an AI answer engine can quote a passage in isolation), adds comparison tables where the topic is comparative, and adds descriptive-anchor internal links to existing pages. No new factual claims were invented; a few figures were pulled in from sibling pages that already state them, and one page's description of how fingerprints are generated was generalised. Voice, technical claims and honest caveats are unchanged.
2026-08-05 23:40:20 +02:00
feder-cr 115666fb0b ci: mirror the docs site to the wiki on each release
Adds scripts/build_wiki.py, which renders docs/ into a GitHub wiki checkout (strips the Jekyll front matter, rewrites internal links to the wiki's extensionless form, names each page by its slug with index.md becoming Home.md, and regenerates _Sidebar.md from the parent and nav_order tree), and .github/workflows/publish-wiki.yml, which runs it on a published release or a manual dispatch and pushes the result to the wiki repo. Also generalises two older pages that described the fingerprint generator in more internal detail than the rest of the set.
2026-08-05 21:52:29 +02:00
feder-cr 39a5b4c55d docs: 55 scraping how-tos by category, data type, and technique
Extends the Scraping with Playwright cluster with category guides (real estate, jobs, e-commerce, prices, hotels, flights, classifieds, cars, rentals, reviews, news, directories, events, restaurants, finance, social, forums, images, video, maps, sports, crypto, deals), data-output guides (CSV, JSON Lines, SQLite, Excel, JSON-LD, Open Graph, links, RSS, images, article text, DataFrame, sitemap), and techniques (search forms, map search, autocomplete, date pickers, list-to-detail crawl, lazy images, canvas charts, wizard flows, resume, incremental, 403/429 backoff, load-more, nested pagination, SPA history). Each names the category's real structural challenge and pairs it with an honest stealth caveat.
2026-08-05 20:13:50 +02:00
feder-cr f3b300b43a docs: 53 detection answers, integrations, and tool comparisons
Adds informational answers to the questions people actually search (how do websites detect bots, what is a browser fingerprint, does a VPN stop fingerprinting, can a website detect a VM or a datacenter IP, is changing the user agent enough), the Playwright-specific versions of the same (is Playwright detectable, does it set navigator.webdriver, does it change my fingerprint), a set of integration how-tos (with BeautifulSoup, pytest, asyncio, GitHub Actions, Celery, cron, Xvfb, Airflow, httpx, FastAPI, Jupyter, and an LLM agent), three more fingerprint-surface explainers, and six tool comparisons checked against each project at source. Every page answers honestly, with a real usage example and the caveat that a real-looking browser still does not fix IP reputation, quotas, or behaviour.
2026-08-05 19:52:13 +02:00
feder-cr bfc8144bf9 record 0.6.1 as published
The workflow could not: branch protection declines the Actions token, so the
step that commits the ledger back was refused after a successful upload.
Corroborated against the wheel the index serves, all 28 files matching.
2026-08-05 16:10:13 +02:00
feder-cr e2deaa5059 0.6.1: pin invisible-core 18.13.0
Carries the wall-clock bound on the engine download. Nothing in this package
changes behaviour, which is why it is a patch.
2026-08-05 15:56:02 +02:00
feder-cr 713d501b3a README: the divider is the border line, not the 4px bar
`---` renders as GitHub's hr, which is .25em of solid colour and reads as a
slab. An empty h2 gets the same 1px border GitHub draws under a heading, which
is the line the rest of the page already uses. Inline CSS is not an option
here: the sanitiser strips the style attribute and returns a bare <hr>.
2026-08-05 15:21:54 +02:00
feder-cr 75f407b124 docs: 55 more guides, from navigator tells to scraping how-tos
Expands the guides across every group: browser-identity properties (buildID, platform/oscpu, vendor/productSub, Accept-Language, devicePixelRatio, maxTouchPoints), render surfaces (emoji, font width probing, shader precision, audio sample rate), network and WebRTC (SOCKS5 vs HTTP, IPv6 leak, HTTP/2, TLS-vs-UA, about:webrtc, offline geo), the automation layer (new_page vs new_context, TargetClosedError, dialogs, downloads, uploads, connect_over_cdp, mobile emulation, isTrusted), a set of practical scraping how-tos (pagination, downloads, uploads, cookie banners, popups, screenshots, PDF, waiting, retries, parallel, rate limiting, tables, iframes, shadow DOM, XHR capture, geotargeting), detector explainers, and comparisons verified against each project at source. Each carries a real measurement or mechanism from the notes, not a generic recipe.
2026-08-05 15:14:49 +02:00
feder-cr f3e54a6bbe README: a rule under the Telegram block
Without it the invitation and the first line of the project ran together as one
column of centered text. The rule makes it read as its own thing above the fold.
2026-08-05 13:56:45 +02:00
feder-cr 5a8ef19726 docs: a scraping how-to cluster, from blocked to behind a login
Adds a Scraping with Playwright guide group and eight practical pages: why a scrape gets blocked and in what order to check, headless machine tells, infinite scroll, proxy rotation with a matching exit, sessions behind a login, running in Docker undetected, using the package in Docker, and avoiding bot detection. Each one uses the real two-line launch and carries a specific mistake we measured rather than a generic recipe.
2026-08-05 03:16:18 +02:00
feder-cr 60b3111340 README: badges at the bottom, not above the fold
They are status, not an argument for reading on, and six of them ahead of the
first line of prose is a lot of pixels spent saying nothing new. They sit under
the footer now, where somebody who wants to check the build can still find them.
2026-08-05 03:00:53 +02:00
feder-cr 3193b819ae README: a Telegram header that asks something
It was a badge with a caption under it, which reads as decoration and gets
scrolled past. Now the first thing on the page names the problems people
actually arrive with, then says where to ask, then gives a button to press.

The banner carried about 180px of empty margin it was paying for in vertical
space, so it is cropped to the artwork.
2026-08-05 02:27:19 +02:00
feder-cr 9d9b584324 readme: say what the group is for, not just that it exists
"join the group" tells nobody why they would. The button now says join the
community and carries one line under it naming what gets asked there: proxies,
fingerprints, captchas, and getting more out of the package the reader is
already looking at.

The line is tailored per repository, because "getting more out of
invisible-playwright" is not what somebody reading the profile manager wants to
hear.
2026-08-05 01:57:54 +02:00
feder-cr 20210fddec readme: the group button first, above everything
It went into the badge row, which is not the top: it is the seventh thing in a
line people skim. Now it is the first element of the file, centred, above the
title and above the other badges.
2026-08-05 01:23:03 +02:00
feder-cr b64f800095 readme: the Telegram group as a badge, not a paragraph
Three lines of prose became one button in the header row, next to the others.
A link people have to read past is not an invitation; a button in the badge row is
where anyone already looks.

The SVG is committed here rather than pulled from shields.io, which is the same
choice every other badge in these repos already makes: nothing in the header
depends on a third-party service being up, and the file is the one this repo
serves.
2026-08-05 01:21:41 +02:00
feder-cr 00441aba97 the e2e step printed nothing for 39 minutes, then the timeout killed it
Not a nicety. Python block-buffers stdout when it is a pipe, so
`xvfb-run -a python scripts/run_e2e.py` produced ZERO output between the step
starting and the 40-minute timeout cancelling it on 2026-08-04. A run with no
verdict and no way to tell where the time went, which is the same shape this
repository keeps paying for: a job whose silence is indistinguishable from
progress.

PYTHONUNBUFFERED is set on the step rather than only passing -u, because the
output that matters comes from the pytest subprocess run_e2e.py spawns, and the
variable is inherited while the flag is not.

This does not explain WHY the run exceeded 40 minutes. It makes the next one able
to say.
2026-08-05 00:55:10 +02:00
feder-cr 8ad766a1a3 a removed flag lived on in the one test that actually runs the CLI
`test_release_e2e.py` still called `fetch --force` three days after `--force`
went with four of the six subcommands in 0.5.0. Every run of that file exited 2
on "unrecognized arguments", and the default suite stayed green the whole time
because the test is e2e-marked and therefore deselected. One stale argument, and
three red workflows: `e2e` on main, and `user-install` on two release tags.

Nothing is lost by dropping it. `fetch` verifies every cached tree against the
seal on every run, which is what --force was for, and the test builds a fresh
venv with an isolated cache root, so there is no warm tree to force past. The
rest of that run was green: 138 passed, which is also the first full e2e this
package has had since new_page started applying the profile's context.

A guard already forbade `--force` in the engine-mismatch MESSAGE. It checked what
the package tells a user to run and never what the tests themselves run, so the
flag survived in the one place that executes it. The new gate validates every
`-m invisible_playwright` invocation in the suite against the real parser, rather
than against a list of removed names that the person who forgot the call site
would also have to maintain.

It took two corrections before it worked, both of them shapes this repository has
recorded before: it flagged its own explanatory comment, and it treated `--help`
as a defect because argparse exits for that too. Exit code 0 is help, 2 is a
parse error, and only the second is a bug.

README: the third-party ad banner is gone and there is a link to the Telegram
group instead. Promotional text in a README has to be related to the project
being hosted, which an ad network is not and a group about this work is.
2026-08-05 00:04:50 +02:00
feder-cr 097671495e the job holding the credential stops installing what it does not need
The upload job carries the OIDC token and `contents: write`, which is the widest
permission set in these repositories: it can push to the default branch. It was
installing the dev extra, which pulls pytest, ruff and - in the wrapper - the
whole of Playwright, into exactly that job.

`record` needs the package importable and a build backend. Verified by running it
with `-e . build hatchling` and nothing else: same eight-field entry, same
digests. So that is what it installs.

Nothing about this was broken. It is the surface of the one job worth keeping
small, and it was large because the step was written by copying the line above
it.
2026-08-02 05:01:26 +02:00
feder-cr b096a9db6b the release walk gains its fourth record, the ledger
The index, the tag, the GitHub release and PUBLISHED.json are four independent
statements about one event, and today each of them was wrong about a different
subset: eleven versions had no release, eight had no tag, one tag sat on a commit
building a different version, two versions were missing from the ledger entirely
and twenty-one entries were missing a field.

Every one of those was found by looking at a single pair, one at a time, over
several hours. The walk now checks all of it in one pass.

The ledger dimension costs no API call - it is a file in this repository. The
publish gate compares it to the index too, but only on a release, so a version
published outside the gate stays invisible until the NEXT release is refused by
it. That is precisely how the 2026-08-02 gap surfaced: a tag push refused for a
reason nobody was looking for. Here it surfaces on every run of the install job.

Mutation: an entry deleted from the ledger. Caught, by version, with the
back-fill rule in the failure message - from the artifacts the index serves,
never from the tree.
2026-08-02 04:43:40 +02:00
feder-cr b61f82ef52 fill requires_dist on the entries recorded before it was written
The recorder omitted it until today while the hand-written back-fills included
it, so nine entries of fourteen could say which core that version asked for and
five could not. Read from the wheel the index serves, with the gate's own reader.

The chain is now readable end to end: 0.4.6 -> core 18.6.0, 0.4.7 -> 18.8.0,
0.4.8 -> 18.9.0, 0.4.9 and 0.5.0 -> 18.11.0, 0.6.0 -> 18.12.0.
2026-08-02 04:41:26 +02:00
feder-cr 8357ed7077 record what was published, and commit it back
The manager's first OIDC upload shipped 0.3.1 and wrote no ledger entry: the
upload goes through pypa/gh-action-pypi-publish, which does the token exchange,
while the thing that writes PUBLISHED.json is invisible_core.release. This
workflow has the same shape and would have done the same on its first release.

record after the upload rather than publish instead of it - the action holds the
credential, and twine cannot do the OIDC exchange itself. Recording the tree is
correct in that job and only there: it is checked out at the tag.
2026-08-02 04:19:16 +02:00
feder-cr 9ed0e035b3 the gate armed the hooks before installing what arming imports
Third real defect this workflow has surfaced by running, and all three were
ordering or wiring that only a run can show:

  1. the pin grep looked for `invisible-core==` while both pyprojects write
     `invisible_core==`, so it exited 1 on a correct file;
  2. it ran the suite in a clone whose hooks it never armed, and the suite
     asserts they are armed;
  3. and the arming step went in BEFORE the install, so `install_hooks.py` - which
     imports invisible_core - died on ModuleNotFoundError.

The install is its own step now, in the order ci.yml has had all along: install,
arm, suite. This file simply had never executed, because every tag before it named
a version the index already served and `already-published` short-circuited both
downstream jobs.

That is the fourth workflow in two days found broken at its first real execution
while looking green. The shape is always the same: a job that no-ops is
indistinguishable from a job that passes.
2026-08-02 04:09:10 +02:00
feder-cr 9facf961f5 the publish gate ran the suite in a clone whose hooks it never armed
`test_the_hooks_are_armed_in_this_clone` asserts core.hooksPath is set. A fresh
checkout has none, ci.yml arms them with `install_hooks.py`, and publish.yml did
not - so the gate job went red on that one test while every other workflow in the
repository was green.

Found by running it. This workflow had never executed its gate: the tags before
it named versions the index already served, so `already-published` short-circuited
and both downstream jobs were skipped.

It is also the same defect the 0.4.8 changelog records, three days later and one
workflow over: "only the core workflow ran install_hooks.py, so both consumers
went red on it". A rule that lives in one file gets re-broken in the next one,
which is the argument for the step carrying its reason rather than just its
command.
2026-08-02 04:00:51 +02:00
feder-cr 6c4d431ce9 record the hand-published version in the ledger, from what the index serves
The gate refuses a release when the index carries a version the ledger does not:
"those were published outside this gate, so there is no record of what shipped
under them and a re-release with different bytes would go unnoticed."

That is what today produced. Trusted publishing was not registered yet, so 0.6.0
and 0.3.0 went out through twine by hand, and the path that writes the ledger
never ran for them. The gap was invisible until a tag push hit the gate and was
refused - which is the machinery working, not failing.

The entry is rebuilt from the ARTIFACTS PYPI ACTUALLY SERVES: both files
downloaded and digested with the gate own functions. Not from today tree, which
has moved on - a record saying "this is what shipped" about bytes nobody received
is worse than the gap, because the gap is visible and the lie is not. There is
precedent in this same file: the 0.2.0 entry carries the same note from the
2026-07-25 backfill.

The first attempt wrote four of the nine fields and the gate refused it by name:
"released[8] has no wheel_filename ... it is the only thing in the entry that
corroborates the version string". seal_tag and requires_dist are read out of the
wheel too, so they come from the published wheel rather than from the tree.
2026-08-02 03:52:21 +02:00
feder-cr e4ca2b5027 docs: the pages that describe a CLI, an API and a proxy that all changed
Every proxy example on the site used `socks5://...` with no port. Since
invisible-core 18.12.0 that is refused with a ValueError instead of launching
unproxied, so the examples would now raise: they carry a real port.

The pinning page offered `fonts` and `locale` as things to pin. Neither is a
profile field and both raise `pin key ... is not valid`, so the page was handing
readers two errors. Replaced with fields that exist.

The integration pages that named removed subcommands are corrected. Two that had
their "written against 0.4.6" line bumped to 0.6.0 by the pass are back at 0.4.6:
nobody re-ran those integrations today, and a version banner nobody made good on
is the same defect in a smaller frame.

The scrapy page said `socks5://` works on both routes. It does not. Playwright's
own proxy option reaches Firefox as a browser-level proxy whose filter answers
with host and port only - the credentials it carries are for an HTTP 407
challenge, while the SOCKS handshake reads its credentials from the proxy prefs,
which only this package's own proxy argument writes. Authenticated SOCKS works on
route one and cannot work on route two, and the page now says so.
2026-08-02 02:43:29 +02:00
feder-cr d7bcb56af3 the changelog stopped four releases ago, and nothing was checking
It sat at [0.4.7] while 0.4.8, 0.4.9, 0.5.0 and 0.6.0 were on the index. 0.5.0 is
the release that cut the CLI from six commands to two, the most breaking change
this package has shipped, and a reader upgrading across it had nothing to read.

Six entries added, reconstructed from the git log rather than from memory. Two of
them - 0.3.6 and 0.4.1 - were found by the gate below, not by the reconstruction:
somebody filling gaps by hand fills the recent ones.

The gate is bounded from BELOW by the file itself. This changelog does not reach
back to the first release and does not need to; what it must not do is stop short
of the present. Every version on the index at or above the oldest documented one
needs a heading, no heading may name a version above the first published one that
the index has never served, and the dates are compared against PyPI's upload
because a date written by the person writing the entry is a small lie a reader
can check.

Its first run found three real things and one defect of its own: it flagged
fifteen pre-PyPI versions as invented. Those nine releases existed on GitHub
before this package went to the index and their entries are history, so the rule
now applies only above the first published version. The three real ones: 0.3.6
and 0.4.1 undocumented, and 0.3.5 dated a day before its upload.

Mutation: the 0.5.0 entry deleted. Caught, by name.
2026-08-02 02:01:22 +02:00
feder-cr 0bba55987d every published version needs a release, not just the latest one
The test that guards it read `info.version` - the LATEST - so the moment a
release went out without its page, the next release hid the omission: the check
moved on and the old gap stayed behind it. Its own docstring said "every version"
from the first line while the code checked one, which is the third time in two
days that a claim written beside the code turned out not to be the code.

Measured 2026-08-02: ELEVEN published versions across the three packages had no
release page and EIGHT had no tag at all, three of them published after the
backfill this test exists to protect. All 36 are backfilled now.

The walk found two things a one-call check could not:

  * invisible-playwright 0.4.4 was uploaded from an UNCOMMITTED working tree.
    PyPI records the upload 8 minutes before the only commit that carries that
    version, and the guard it was meant to ship did not make it into the
    artifact. The next release message says so: "0.4.5 - 0.4.4 shipped without
    the import guard and cannot be corrected";
  * its tag pointed at the commit that builds 0.4.5.

Two mutations, both of which changed the code:

  * deleting an OLD release passed. A rate-limit 403 two versions later hit an
    unconditional `pytest.skip`, throwing away the violation already in hand. A
    gate that discards its own findings on an unrelated error is worse than no
    gate, because it reports PASS. It now fails with what it found and skips
    only when it found nothing;
  * unauthenticated, with the limit already spent, it skipped on the FIRST call
    while saying "all clean so far" - green because it never ran, the shape this
    project met three times in two days. That skip now says NONE were checked,
    and CI passes GITHUB_TOKEN so the walk is authenticated: 60 calls an hour per
    runner IP does not cover one call per version across three repositories.
2026-08-02 01:56:35 +02:00
feder-cr a8cbe9be6c the publish gate looked for the pin by the spelling used in the comments
`invisible[-_]core==`, both separators. PEP 503 normalises the two to the same
project, and this pyproject writes the dependency with the UNDERSCORE while every
comment about it uses the hyphen. The gate was written against the prose, so the
grep matched nothing and the step exited 1 on a perfectly correct file - it would
have refused every release, for a reason that had nothing to do with the release.

Found by RUNNING it. Three workflows in two days turned out to be broken at their
first real execution while looking fine: a step reading a version out of a
pyproject that declares it dynamic, a job that had only ever been skipped, and
now this. So each step of this file was extracted from the YAML and executed
against the working tree, with mutations: a pin naming an unpublished version
(refused, 404), the pin removed entirely (refused), a tag not matching the
version (refused), and the correct state (allowed).
2026-08-02 01:10:24 +02:00
feder-cr 01c2512771 0.6.0
browser.new_page() now gives the page the same context as browser.new_context():
the profile's viewport, screen, DPR, colour scheme, locale and timezone. It did
not, because Playwright's new_page forwards to the implementation object, whose
own new_page calls new_context on ITSELF, so the wrapper installed on the api
object was never consulted. Measured in a browser with one seed: innerWidth 1280,
Playwright's stock viewport, against a fingerprint reporting screenWidth 1920 -
and a dark-pinned profile came back light.

That is a behaviour change on the call this package's README, class docstring and
every example use, which is why this is a minor bump and not a patch. A page from
new_page() is now the size the fingerprint says it is.

build_prefs takes the core's single prefs composition, so the three entry points
that used to stack layers in their own order now agree, with the difference
asserted as an exact set.

Also: the engine-mismatch message no longer tells you to run a flag that was
removed, eight dead imports are gone, four tests marked unit stopped making real
network calls and waiting out a ten-second deadline, and CI runs 3.11 through
3.14 on both platforms.
2026-08-02 00:11:40 +02:00
feder-cr eee4bd9fed build_prefs takes the core's composition, and the pin moves with it
The third of the three places that stacked layers on top of
translate_profile_to_prefs in its own order. The core composes it now; what stays
here is this path's delivery and its two decisions - the cloak, which only
Windows and macOS need, and which generator draws the pointer path.

max_seconds_for is applied HERE rather than passing humanize through, and the
test that pins it says why: humanize=0 with the binary engine selected is a cap
of nothing, not a request to disable motion, and passing it straight to the core
would make it falsy and switch the generator off. That is a different browser,
and it is the kind of edge a delegation quietly changes.

Four tests, one of them the wrapper's arm of the comparison the core added: the
same seed through build_prefs and through get_default_stealth_prefs must produce
the same prefs, with the allowed difference asserted as an exact set. It lives
here because this package pins invisible-core== exactly and the core's suite
cannot import a consumer.

Mutations: humanize passed through unmapped, and the cloak applied
unconditionally. One test each.
2026-08-01 23:09:04 +02:00
feder-cr 08cc7a90c6 publish from a tag through OIDC, and run 3.13 and 3.14
Uploaded by hand until now, from one machine, with a long-lived PyPI token on
it. The credential is the pypi environment's OIDC trust relationship now, minted
per run, and the upload job is behind a gate that checks three things a person
had to remember: the tag names the version being built, the invisible-core== pin
is already on the index, and the suite passes - a tag push does not trigger the
ordinary test workflow, so without that last one tagging is a way to publish code
no job has run.

The matrix covers every version requires-python promises. 3.13 and 3.14 have
never run here.

Before the first run this needs a GitHub publisher registered on PyPI (owner
feder-cr, repo invisible_playwright, workflow publish.yml, environment pypi).
Until then the upload fails with invalid-publisher, which is the correct failure.
2026-08-01 22:21:45 +02:00
feder-cr c735a975b3 dead imports, a message naming a removed flag, and four unit tests doing real work
Eight imports in launcher.py and async_api.py were unused. The ninth,
IANA_TO_POSIX_TZ in _session.py, is not: the import IS a probe that turns an old
core into a message about a version instead of a message about a symbol. It gets
a noqa with the reason, not a deletion.

_engine.py told a user with an engine mismatch to run `fetch --force`, three days
after that flag was removed with four of the six subcommands. A test pinned the
old string, so both were wrong together. The test now requires the fix line to
name a command the CLI actually has and no flag at all, which is a check the
string could not fail on its own.

Four tests marked unit drove __enter__ with Playwright mocked and made two real
network calls each - the geo lookup and the locale lookup, the second imported
inside the function, so patching the launcher's namespace does nothing for it -
then sat out the lifetime guard's full 10s deadline waiting for a browser tree
that a MagicMock never produces. 45.6s -> 0.34s for that file.

utcfromtimestamp returns a naive datetime and is deprecated since 3.12, which
matters now that the CI matrix is about to reach 3.14.

pytest-mock and responses were declared and never used by any test in this
package. ruff was NOT declared and CI pip-installed it unpinned on every run: the
tool that gates every push could change under us between two pushes. It is in the
dev extra now, in all three, and CI uses that one.

The suite-boundaries docstring said ten shims and named two modules that are not
shims by its own derivation, three lines below it.
2026-08-01 22:10:00 +02:00
feder-cr 060914971d browser.new_page() opened a page with the stock viewport, not the profile's
The wrapper installs the profile's viewport, screen, DPR, colour scheme, locale
and timezone as defaults on browser.new_context. new_page never went through it.

Playwright's Browser.new_page forwards to the IMPLEMENTATION object, and the
impl's own new_page does `context = await self.new_context(**params)` - itself,
the impl - so a wrapper installed on the api object is never consulted. Read on
the installed Playwright and then measured in a browser: with the seed the e2e
uses, new_page gave the page innerWidth 1280, Playwright's stock viewport,
against a fingerprint reporting screenWidth 1920, while new_context gave 1906.
A dark-pinned profile came back light on the same path.

new_page is the call in the README, in the class docstring and in every example
this package ships. A viewport that contradicts screen.width is not a missing
feature, it is the kind of internal inconsistency the package exists to remove.

Both APIs, because they have drifted apart before. Written through the public
new_page rather than by reaching into the impl, so Playwright's own ownership
wiring - closing the page closes the context it owns - stays intact instead of
being reimplemented against private attributes. The about:newtab settle applies
to this tab too: it is the same race, and a caller doing `page =
browser.new_page()` goes straight to goto(). That 0.4 is now one named constant
shared by both APIs.

Four unit tests and one e2e. The unit tests fail with the patch removed (three of
four); the e2e fails in a real browser with the exact 1280-vs-1906 difference,
which is what turns this from a reading of Playwright's source into a measurement.
2026-08-01 21:45:33 +02:00
feder-cr d737cf7d68 ruff: select F601 beside F821 and F811
A dict literal with a repeated key silently keeps only the last one and Python
does not warn. It cost an hour in the core, where a contract row added under a
key that recurred later in the same literal was discarded without a word while
the test it was meant to satisfy kept failing and naming that very entry. Zero
violations in the three repos when it went in.
2026-08-01 21:22:46 +02:00
feder-cr 6d6b45c112 badge: browser launches at 1.16M 2026-08-01 20:08:38 +02:00
feder-cr 3bfeb9535f badge: browser launches at 1.16M 2026-08-01 19:56:34 +02:00
feder-cr 9e7be64592 ledger: 0.5.0 2026-08-01 19:36:40 +02:00
feder-cr 0477dcdf3c release: 0.5.0 - six commands become two, and fetch does the checking
The CLI was fetch, fetch --force, path, version, clear-cache and doctor. Every
one of them was a step somebody had to know to take, in a package whose whole
promise is that the browser handles itself. None of the behaviour is gone.

doctor now runs inside fetch, on every run, before the download rather than
after. That ordering is the point: a cached tree that no longer matches the seal
is the case worth catching, and it is invisible to a "download if missing" that
only looks at whether a file exists. It was the thing most worth doing and the
thing least likely to be typed, which is the worst combination a subcommand can
have.

--force is unnecessary once every run verifies: a tree is replaced because it
does not match the seal, not because a flag was passed.

path is the last line of fetch's stdout, so `$(invisible-playwright fetch)` is
the scripting form - and unlike path it guarantees the thing it names exists and
matches. The mismatch report goes to stderr so it can never end up inside a
captured path.

clear-cache is deliberately NOT folded in. The cache root is shared with
invisible_firefox, so pruning trees no seal points at would delete the other
product's engine on a machine running both. `version` prints the location
instead; removing a directory is a thing a person can do without a subcommand.

The tag argument went with them. The seal decides which engine a build runs and
verify_engine refuses anything else, so a tag on the command line could only ever
name something that would then be rejected.

Breaking for anybody scripting the four that are gone, which is why this is a
minor rather than a patch. They fail loudly rather than being ignored, and a test
asserts that.

The surface is asserted as an EXACT set, not a subset: a subset check passes
while the CLI grows back one convenience at a time, which is how it reached six.
Three mutations: the verification removed, a third command added, and a line
printed after the path.

426 passed.
2026-08-01 19:36:15 +02:00
feder-cr c407928dd2 readme: drop the sponsor heading, keep the sponsor
The block reads fine without a section title above it, and the title was the first thing on the page.
2026-08-01 19:27:44 +02:00
feder-cr 2942dc4ac4 docs: the launches badge shows a real number again, and links where it lives
The badge SVG has read a hand-written 1M since it was made. It is now rendered
from the snapshot data: the total counted before 22 July plus the live counter,
which is a sum, and a download count cannot be transferred to a new asset.

The link went to the old release, whose count froze on 22 July when the ping
URL stopped resolving to it. It now points at the release the binaries actually
GET.
2026-08-01 19:14:49 +02:00
feder-cr ff5afb86ba ledger: 0.4.9 2026-08-01 18:53:10 +02:00
feder-cr 29e3dadb11 release: 0.4.9 - the pin follows the core past a shape that lasted one release
invisible-core 18.10.0 classified a 404 on the engine archive instead of raising a
bare HTTPError, which is issue #51, and 18.11.0 removed the part of it that ran
`pip install --upgrade` on the caller's environment. A library that installs
things while it is running mutates an environment nobody asked it to touch,
ignores whatever lockfile chose that version, and inside a container rewrites an
image layer at runtime.

What reaches a user of this package: a 404 on the engine now says whether the
release was retired on purpose - in which case no retry will find it and the
message carries the upgrade command - or whether the tag is current and the fault
is ours.

Nothing here changed. This release is what lets an install resolve that pair.

428 passed.
2026-08-01 18:52:56 +02:00
Federico 22f86499a6 docs: add GitAds sponsor snippet 2026-08-01 02:46:17 +02:00
Federico b6bf924edc chore: add GitAds verification code 2026-08-01 02:41:53 +02:00
Federico f505113151 docs: remove sponsor badge 2026-08-01 02:08:08 +02:00
Federico b324b27723 docs: add sponsor badge 2026-08-01 02:01:29 +02:00
feder-cr af895b9b25 docs: generate BreadcrumbList JSON-LD from a Jekyll include, not per-file
Every article had a hardcoded <script type="application/ld+json">
block right after its front matter. On the built Pages site this
renders invisibly in <head> as intended. On github.com's own blob
view - the exact page type this project has spent this whole session
converting README links toward, for its dofollow authority - GitHub's
markdown renderer doesn't execute <script> tags but also doesn't hide
them: it printed the raw JSON as visible text at the top of every
single article, right above the actual content.

Moved the breadcrumb generation into docs/_includes/head_custom.html,
the theme's documented custom-head extension point (a plain Liquid
include, not a Jekyll plugin, so it's fully compatible with GitHub
Pages' safe build mode). It reads page.parent/page.grand_parent/
page.title from front matter and emits the identical BreadcrumbList
schema into <head> at build time - same output on the live site,
nothing left in the markdown source to render badly on GitHub.

Verified the new template reproduces every existing hardcoded block
byte-for-byte by simulating it in Python against all 82 files that
had one, before removing any of them. That check caught two
pre-existing, unrelated bugs along the way: cross-origin-iframe-
unreachable.md was missing its breadcrumb script entirely, and
slow-browser-launch-timeout-budget.md's script pointed at a 404'd
slug (guides-testing-and-troubleshooting.html instead of the real
guides-testing-troubleshooting.html) and its front matter was
missing grand_parent: "Guides", which the sidebar nav depends on.
Both are now fixed automatically by the shared template; the missing
grand_parent field is also corrected directly in front matter.

Stripped the now-redundant hardcoded script block from all 82 files
that had one.
2026-07-31 22:02:37 +02:00
feder-cr 07c3e85ad9 docs: why a plain Python requests scraper gets blocked before it sends a header
New article for the non-browser scraping audience, tool-agnostic
rather than Playwright-specific: python-requests carries its own TLS
fingerprint via Python's ssl/OpenSSL stack, distinct from any real
browser's, and a site checking JA3/JA4 rejects the connection before
any header, cookie, or user agent the script sets even exists as part
of it. Names curl_cffi as the legitimate impersonating-client fix for
non-JS scraping, and points to a real browser for anything that needs
JavaScript execution. Cross-linked from ja3-ja4-tls-fingerprint.md,
the browser-side version of the same argument.
2026-07-31 21:45:42 +02:00
feder-cr e57be7b945 docs: why web scraping keeps getting blocked even with good proxies
New article targeting the broad 'web scraping getting blocked' search
space directly, tool-agnostic rather than Playwright-specific, since
that space is dominated by generic proxy/delay advice from scraping-
API vendors. The angle this site can argue better than that content:
a proxy only changes the exit IP, and a growing share of sites cross-
check that IP's country against the browser's own timezone, language
and number formatting - a mismatch that survives every proxy quality
upgrade because proxy quality was never the variable it depends on.
Summarizes and points to the existing Playwright-specific field-by-
field breakdown in timezone-proxy-mismatch.md for readers who want
the full detail, and is cross-linked from there.
2026-07-31 21:32:34 +02:00
feder-cr e53308b67d docs: invisible_playwright vs playwright-with-fingerprints, whose device and whose engine
New comparison article: playwright-with-fingerprints injects values
sourced from a remote paid service (FingerprintSwitcher) rather than
generating them locally - a genuinely different answer to where a
fingerprint comes from. Its own README states three separate facts
worth naming: Windows-only, pinned to a specific and already-ageing
Chromium build (146.0.7680.80 against a current default several
versions ahead), and self-described as beta. Same injection-layer
limitation as every other page-level tool on this site, plus an
external-service dependency none of the locally-seeded approaches
have. Cross-linked from vs-fingerprint-suite.md and added to the
top-level README's Related projects list.
2026-07-30 15:58:21 +02:00
feder-cr 50e9d92be7 docs: why automating the login form is riskier than reusing a session
New article from a real automation pain point rather than a tool-status
check: the login flow is the most heavily monitored sequence on most
sites, and Playwright's storage_state lets a script skip it entirely
by reusing a session captured from a real login. Covers the one hard
requirement that makes this safe rather than a false sense of
security: the fingerprint replaying the session has to match the one
that created it, since some sites bind a session to more than the
cookie. Cross-linked from persistent-profiles.md as the storageState
half of the same identity-continuity question.
2026-07-30 15:16:55 +02:00
feder-cr bfe801fede docs: Playwright's Chromium-vs-Chrome codec gap closed in 1.57, Widevine didn't
Significant, verified update to a cornerstone comparison article. As
of Playwright 1.57, the default managed Chromium binary (no channel
set) is Chrome for Testing, not the old custom-compiled open-source
build - confirmed against Playwright's own release documentation.
Checked directly in a live session: H.264 and AAC now play on the
current default, closing the codec half of this page's original
argument. Widevine does not: requestMediaKeySystemAccess still
rejects with NotSupportedError, because Chrome for Testing carries
Chrome's codecs but not its DRM module. Rewrote the article around the
surviving Widevine-specific gap rather than the now-partially-outdated
codec claim, and propagated the same correction to the two other
articles that repeated the old 'Chromium has no H.264' framing
(firefox-vs-chromium-antidetect.md, vs-patchright.md).
2026-07-30 14:22:04 +02:00
feder-cr 476e2f9816 docs: a real CreepJS score from an unmodified session, tightly scoped
Second live-detector run this session. CreepJS's headless module
returned 0% headless / 0% stealth (25% 'like headless' partial score)
against a stock Playwright Chromium session with no stealth layer
applied at all. Reported only the safe, aggregate percentages -
deliberately excludes everything else CreepJS collected in that run,
including real network-identifying data that has no place in a public
article. Scoped explicitly as one session's result, not a general
claim about Playwright's default detectability.
2026-07-30 13:56:49 +02:00
feder-cr e3d7bf87b0 docs: a real, live run against sannysoft, carefully scoped
Ran a live Playwright-driven Chromium session directly against
bot.sannysoft.com via the available browser tooling rather than
describing the page from memory. All eleven group-one rows passed,
including WebDriver and WebDriver Advanced, through a genuinely
native, unpatched getter reporting false on its own. Added as a
tightly scoped observation - explicit that this describes one
directly-checked session, not a guarantee about every Playwright
launch configuration, consistent with the page's own point that
clearing this table is the easy part regardless of how it happened.
2026-07-30 13:44:57 +02:00
feder-cr ec7ab894f5 docs: checked a circulating claim about a Playwright global marker, found nothing
A claim repeated by several current SEO-content pages describes a
'window.__playwright' marker as a Playwright-side equivalent of
Selenium's cdc_ variable. Checked directly in a live Playwright-driven
Chromium session by enumerating every own property on window: no such
property, and nothing resembling it. Updates the FAQ answer to state
this as a checked finding rather than a vague 'every stack has its own
artefacts' non-answer, consistent with the page's own point that a
claim should be verified by opening a real session rather than
repeated from a description of one.
2026-07-30 13:29:46 +02:00
feder-cr 2d9ae0ea5b docs: invisible_playwright vs fingerprint-suite, same generation model different layer
New comparison article: Apify's fingerprint-suite generates a coherent
fingerprint with a Bayesian network, close to this project's own
seed-to-fingerprint approach, then injects it via Playwright/Puppeteer
into a running Chromium or Firefox instance - same generation
philosophy, different layer. The injection mechanism carries the same
overwrite-signature limitation as every other page-level tool covered
on this site, independent of how realistic the underlying values are.
Cross-linked from vs-playwright-stealth.md and added to the top-level
README's Related projects list.
2026-07-30 01:51:42 +02:00
feder-cr 94faa93cba docs: rebrowser-patches independently converges on Patchright's CDP fix
New comparison article: rebrowser-patches fixes the same Runtime.enable
CDP leak Patchright addresses, on the same protocol, by close to the
same technique (manual execution-context management instead of the
automatic call), arrived at with no shared code between the two
projects. Neither reaches Firefox; both explicitly scope themselves
away from fingerprinting per their own docs. Generalized the vendor
names their own README uses for the detection side, per the site's
naming ceiling. Cross-linked from vs-patchright.md and
playwright-stealth-levels.md's existing passing mention, and added to
the top-level README's Related projects list with the same treatment
as the other five entries.
2026-07-30 01:39:01 +02:00
feder-cr 5736c9769b docs: pyppeteer's own maintainer recommends Playwright, and why that's not just staffing
New article: pyppeteer's own README opens with an unmaintained notice
pointing to playwright-python. Unpacks why the recommendation lands
on Playwright specifically rather than a more active Puppeteer fork -
Playwright's driver abstraction covers three engines through whatever
protocol each one actually supports, a wider foundation than a
CDP-only port can be extended into. Separates that maintenance
argument from the unrelated question of whether switching drivers
fixes automation detection on its own (it doesn't). Added to the
top-level README's Related projects list and cross-linked from
vs-playwright-stealth.md, same authority treatment as the other four
comparison entries.
2026-07-30 01:21:20 +02:00
feder-cr f773022a6f docs: fake-useragent's 2026 archive, plus a playwright-extra clarification
New article: fake-useragent (Python, 4k+ stars) was archived by its
own maintainer in 2026, verified directly via GitHub's archive flag -
the strongest possible signal, no inference needed. Covers the
practical break (frozen string database) and the more durable point:
a realistic string was always one claim among many that get
cross-checked, so a stale database makes the tell cheaper to find
rather than creating a new problem. Cross-linked from
playwright-user-agent.md and selenium-stealth-unmaintained.md.

Also adds a one-line clarification to the puppeteer-extra-plugin-stealth
article: playwright-extra ships from the identical repository, so a
reader searching that term specifically gets a direct answer instead
of having to infer it.
2026-07-30 00:47:32 +02:00
feder-cr 8c6652bb7a docs: AI agent detection stopped being theoretical in 2026
Adds a section to the existing AI-browser-agents article covering a
real, current development found through keyword research: a
commercial fingerprinting vendor shipped a dedicated AI agent
detection product in early 2026, and recent academic work has been
building multi-layer fingerprints specifically targeting LLM-driven
browsing sessions. Reinforces the article's existing agent-timing-
signal section with a concrete, dated reason it now matters at
production scale rather than as an edge case.
2026-07-30 00:23:22 +02:00
feder-cr 0d1236b244 docs: add the two new comparison articles to the top-level Related projects list
puppeteer-extra-plugin-stealth and selenium-stealth were written up
this session but only cross-linked between docs pages, missing the
same top-level README authority treatment every other comparison
article already gets. Added both under the Chromium side list,
matching the existing format and tone.
2026-07-30 00:16:48 +02:00
feder-cr e6a2215544 docs: selenium-stealth's real maintenance status, verified
Second keyword-research-driven article this batch. selenium-stealth
still appears in current tutorials for hiding Selenium automation;
its actual repository has had no commits since December 2021, over
four and a half years, verified directly. Same structure as the
puppeteer-extra-plugin-stealth piece: separates the staleness question
from the durable architectural ceiling shared by every page-level
property-patching approach. Cross-linked from cdc-variable-explained.md,
which covers the adjacent Selenium-specific detection surface.
2026-07-30 00:11:17 +02:00
feder-cr f69f26a45e docs: puppeteer-extra-plugin-stealth's real maintenance status, verified
New comparison article targeting a real, currently-searched keyword
gap identified through explicit keyword research: 'puppeteer stealth'
carries heavy search volume dominated by scraping-vendor content, but
the actual home repository behind the plugin (berstend/puppeteer-extra)
has had no substantive commits since July 2024, verified directly
rather than assumed. Separates the maintenance question (a frozen
patch list against evolving detection) from the durable architectural
ceiling (page-level property patching, current or not, never touches
TLS, GPU output, or font rendering). Cross-linked from
vs-playwright-stealth.md at its existing puppeteer-extra-plugin-stealth
mention.
2026-07-30 00:05:06 +02:00
feder-cr ad8827f397 docs: a packaged Firefox build that launched fine but Playwright couldn't drive
New article: a browser build passing every manual smoke test
(launch, screenshot) still failed for Playwright specifically, with
TargetClosedError and a chrome://juggler load failure. Root cause was
a packaging manifest that assembled the shipped archive from an
explicit file list and never listed the automation-layer directory
alongside its sibling component, even though the developer build
output had it. Every existing gate tested the developer output path,
never the actually-packaged artifact a user receives. Fixed with one
manifest entry plus a gate that drives the real packaged binary
instead of a proxy for it. Cross-linked with the other two release-
gate-blind-spot articles from this session.
2026-07-29 23:21:38 +02:00
feder-cr 82f148c9d3 docs: why a per-request timeout didn't bound an occasionally slow launch
New article: a launch-time network resolution step tried up to three
endpoints in sequence, each individually timed out and working
correctly, with no bound on the sequence as a whole. One launch in six
hit the worst case. Fixed with a shared budget across the step rather
than tuning any single timeout, and a failure message that reports how
many endpoints were reached before the budget ran out. Cross-linked
from orphaned-browser-process-windows.md as the same lesson in the
same layer: individually correct pieces, no bound on their sum.
2026-07-29 23:10:37 +02:00
feder-cr f082f46b0f docs: a second, distinct gap behind the same green WebRTC gate
The article already covers assertions too weak to fail on a dead
feature. Adds the separate, later discovery that even after fixing
those assertions, the test suite had been exercising a config the
wrapper's own shipped baseline never actually turned on by default -
same outward symptom (green gate, feature unavailable to real users),
opposite cause. Fixed by making the baseline match what the test
already assumed instead of the reverse.
2026-07-29 22:31:01 +02:00
feder-cr 496be20fe9 docs: why a killed test runner leaks Firefox processes on Windows
New article on the automation-layer side of process management: a
killed parent process never runs any in-process cleanup code, so a
job-object-based fix is needed at the OS level rather than in a
try/finally. Covers the wrong first diagnosis (the exception path
never actually leaked, measured by controlled A/B before trusting
the fix), the correct one, exact token-based process identification
to avoid killing a concurrent session's browser by mistake, and a
vacuous test that passed with its own guard removed. Cross-linked
from how-to-test-bot-detection.md as an example of the same false-
pass trap showing up inside a test rather than a fingerprint check.
2026-07-29 20:57:48 +02:00
feder-cr 4bd2d02668 docs: the macOS font gap that needed two separate fixes, not one
Adds the concrete macOS story behind the article's brief 'the same
check runs in CI, and it has passed there too' line: a missing
CoreText hook (found by code review, no local Mac available) and a
build-configuration default that silently disabled the whole bundled-
fonts subsystem on that one platform, which also compiled out the
hook that had just been added to fix layer one. The first fix looked
complete and was not; only an automated run on the real OS caught the
second layer.
2026-07-29 20:51:43 +02:00
feder-cr f27e2fb81b docs: how the window cloak was validated, and a crash it fixed for free
Adds the concrete validation behind the 'third option' section: the
window-hiding approach was latent-broken for several releases on
Windows (a thread-vs-process desktop-inheritance mistake, invisible
to the test suite because it happened to use the correct mechanism
itself) and never worked on macOS at all. Also documents an earlier,
unrelated-looking cross-process-navigation crash that the current
window-level cloak closed as a side effect, because it stopped
splitting a browser's processes across two desktops.
2026-07-29 20:46:11 +02:00
feder-cr 951863b94b docs: a closed cipher-drift bug as a worked example on the TLS page
One extra cipher suite in our build's ClientHello, versus stock Firefox
of the same version, traced to a channel-gated pref default that had
drifted out of sync with the currently shipped upstream release - the
TLS code itself was never touched. Fixed by forcing the pref to the
upstream-current default; JA3/JA4 and the full handshake came back
byte-identical to stock. Reinforces the article's real-browser claim
with a concrete measured gap and fix, and the maintenance point that
follows from it.
2026-07-29 20:39:44 +02:00
feder-cr 9493764cb3 docs: a closed enumeration-vs-rendering bug as a worked example
Adds a real, closed example to the bundled-fonts article: a .ttc
collection font on Linux enumerated correctly while rendering the
wrong face, because the table-reading code never checked for the
TTCHeader ttcf marker. Fixed by reading the requested face's own
offset from the collection directory instead of assuming a single-face
file. Ties directly into the article's existing gap list and the
project's enumeration-is-not-enough point, with before/after metrics.
2026-07-29 19:58:08 +02:00
feder-cr dedc60e411 docs: three Playwright failures on one iframe, one cause, two wrong fixes first
New article, mined from 71-bug-archive.md (a source file not touched before -
distinct from 70-known-bugs.md, which holds still-open bugs excluded by the
established rule; this archive holds only resolved ones, so it doesn't carry
the same disclosure risk).

The real content: content_frame() returning None, frame.evaluate() throwing
a cross-origin permission error, and frame_locator() timing out all read as
separate bugs on a cross-origin iframe, but share one root cause - Firefox's
site-isolation strategy can put that iframe in a separate process, and the
driver's parent-side frame tree only gets a placeholder for it, missing the
exact reference each of the three operations needs.

Kept the honest part of the story too: the first two fix attempts were
wrong, and worth explaining why rather than skipping past. One wrapped a
property read in try/catch for an exception that never fires, because the
property isn't exposed to that scope at all - nothing to catch. The other
compared two identifiers that were both unreachable from where the check
ran, so the comparison could never distinguish the broken case from the
working one. Neither fix was tested against a reproduction that failed
before and passed after; both shipped on a plausible theory alone.

Generalized away everything specific to the source incident that rule 13
excludes - a real target site's name, a reporter's GitHub username, and a
third-party consent-platform vendor name are not in the published version;
the technical mechanism (cross-origin iframe, site isolation, frame tree)
carries the whole article without any of them.

Wired into The Automation Layer (nav_order 9), cross-linked from
debugger-timing-detection.md's opening (same frame-tracking machinery,
different failure mode).
2026-07-29 19:46:10 +02:00
feder-cr bb6fc67b91 fix: exclude the thin README stub from the sitemap
docs/README.md is a 4-line pointer at the real site, kept only so browsing
the folder on github.com shows something. It was still being submitted in
sitemap.xml as thin, near-duplicate content of the real homepage
(index.md), which the sitemap already lists correctly at the site root.
jekyll-sitemap respects sitemap: false per page - added it here, nowhere
else needed it.
2026-07-29 10:16:10 +02:00
feder-cr 9e7b9fc1e2 docs: fix the last .html leaks and link every orphan page
Scanned all 83 pages for two things: relative .html links (dead on the
blob view, since blob serves the raw .md) and pages receiving zero inbound
links from sibling articles.

12 .html links found, all in the four Documentation pages
(installation/quickstart/configuration/cli-reference.md) - written before
the blob-vs-Pages distinction was found, so they'd missed the fix applied
to the hub pages earlier. Fixed the same way: .html to .md.

7 real orphan content pages found (three more flagged - README.md,
index.md, integrations/README.md - are entry points, not orphans, and
don't need inbound links). Added one genuine in-body link to each from a
naturally related sibling: bfcache-pageshow-persisted and
execution-context-destroyed from the detection checklist's automation-tells
section, measuretext-textmetrics-fingerprinting from canvas-fingerprint-noise
(same canvas element, different surface), permissions-api-consistency from
headless-vs-headful's observable-differences list, service-workers-storage-partitioning
from web-workers-fingerprint's ServiceWorker mention, vs-playwright-stealth
from tostring-native-code-detection's engine-argument section (a concrete
example instead of the abstract one), webrtc-ice-candidate-spoofing from
webrtc-leak-proxy's synthesized-candidate section.

Re-scanned after: 0 .html links, 0 real orphans.
2026-07-29 03:12:36 +02:00
feder-cr f77e2d5873 docs: BreadcrumbList structured data, not FAQPage - FAQ rich results are dead
Checked before building: Google deprecated FAQ rich results entirely on
2026-05-07, extending the August 2023 restriction (which had already limited
them to government/health sites) to nobody at all. Building the FAQPage
JSON-LD I'd planned would have added real engineering work for zero visible
benefit, so stopped before writing it to any file.

BreadcrumbList is still fully supported and fits this site better than FAQ
ever did: the hierarchy is already sitting clean in every page's own front
matter (parent/grand_parent), so this needed no markdown parsing at all,
unlike the FAQ approach would have. Generated a Home > Guides >
[sub-category] > [article] trail (or the 3-level Home > Comparisons/
Documentation/Integrations > [page] version) for every one of the 77 pages
that has a parent field, using the same title-to-URL mapping the site's own
nav already relies on.

Verified: all 77 generate syntactically valid JSON, the site verification
script still passes on all 83 pages (title==H1 unaffected, since this
inserts between front matter and the H1, touching neither), and no
forbidden names or secrets in the diff.

No GitHub Pages plugin needed - this is why it went in the page body as
inline JSON-LD rather than through a theme layout override: GitHub Pages'
safe build mode only allows a fixed plugin whitelist, so anything requiring
a custom Jekyll plugin to parse content at build time was off the table.
2026-07-29 01:55:34 +02:00
feder-cr 9fade94c7a docs: two openings led with another article instead of their own topic
Audited every article's H1 and opening paragraph specifically against how
Google's search snippet gets built when it ignores GitHub's generic blob
meta description: the first ~155 characters have to stand on their own,
because that's roughly the truncation point.

Found two pages, both mine, that opened by crediting a companion article
before saying what the page itself is about - bundled-fonts-cross-platform.md
led with "[Why headless browsers render different fonts] covers the
problem," and canvas-webgl-cross-platform-consistency.md did the same with
two links. Truncated to a snippet, both read as being about a different
page entirely. Reordered both to state their own value first, then point to
the companion piece afterward - same links, same content, just not the
first thing a truncated snippet shows.

Checked all 83 pages for this specific pattern (first line opening with a
markdown link) - only these two had it. Two other pages that looked flagged
by length alone (execution-context-destroyed.md, permissions-api-consistency.md)
turned out fine on inspection: both open with a code block that a naive
first-paragraph extraction stops at, but the real prose right after reads
well as a snippet on its own.
2026-07-29 01:45:36 +02:00
feder-cr d0e8e3b64a fix: hub pages linked .html on github.com, which is a 404 there
docs/index.md, documentation.md, guides.md and comparisons.md linked to
each other and to individual articles with the .html extension - correct
for the published Pages site, dead on GitHub's own blob view of the same
file, since blob serves the raw .md and .html simply does not exist there.
Verified: guides-browser-identity.html was a confirmed 404 on github.com
before this fix. Switched all four to relative .md links, matching every
other page on the site.

Also converted the individual article links in README.md's own guide list
and Related Projects section - previously all pointing at
feder-cr.github.io, which GitHub marks rel="nofollow" on every outbound
link (verified against the rendered page). Relative docs/x.md links from
README instead stay inside github.com, carry no nofollow (verified against
same-domain links elsewhere on the page, e.g. the LICENSE link), and put
the repo's own domain authority behind ~20 individual articles directly
from the single highest-traffic page in the project. Left the one link to
the bare Pages homepage as-is, since that's the genuine pointer to the
actual searchable site experience, not a page competing for the same
keyword as its own blob copy.
2026-07-29 01:19:10 +02:00
feder-cr 64f00d94ea the README made four claims nothing checked, and one of them was wrong
Audited by listing what the page asserts and asking which had a test. Sizes did.
CLI subcommands did, in both directions. The rest did not.

The engine version. "Firefox 151.0" in a badge alt text and again inside the
generated docs/badges/firefox.svg that nobody re-reads. Same defect as the
firefox-15 that was shipping in the profile manager's status bar, in a more public
place: a number the seal owns, copied, waiting for the next engine roll.

The supported platforms. Five archives in the seal, five platforms on the page,
nothing tying them together. A platform claimed but not built is a download that
404s for whoever believed the page; one built but not claimed is quieter and still
wrong.

The examples. Seven fenced python blocks and not one had ever been compiled. A
stray comma there costs a reader their first five minutes.

And the field count, which was simply wrong. "~400 fields" measured against a real
profile: 197 leaves on the most generous count, which treats every bundled font
name as a field; 155 prefs emitted; 157 including the stealth baseline. No reading
supports 400. Corrected to ~200 - the number, not the sentence.

Two of the four gates failed their own first mutation. The platform check accepted
a bare family name, so deleting the whole "macOS arm64 / x86_64" claim left it
green - the word macOS still appears in the Gatekeeper note two lines down, and a
passing mention satisfied it. Tightened to exact phrases. The other apparent
survivor was a bad mutation of mine: I broke a line inside a diff block and
expected the python-block scanner to see it.

428 passed.
2026-07-28 21:33:56 +02:00
feder-cr cd904bcdfb Revert "docs: prep_recaptcha was shipped and completely undocumented"
This reverts commit 9d21ce019b, on request.
Removes both additions cleanly: the "reCAPTCHA cookie pre-seeding" section
in configuration.md and the "Why this had to be built in Python, not C++"
section in recaptcha-v3-score.md. Nothing else touched either file since,
so this is an exact inverse.
2026-07-28 21:03:25 +02:00
feder-cr 5ba890bcc6 docs: the reason that produces no error anywhere, from the internals reference
Sixth reason on the list, from mining 90-firefox-internals.md: a preference
set correctly in the parent process can be silently empty in a content
process, and it's specific to string preferences. Numeric and boolean
preferences generated through Firefox's static-preference mechanism get
baked into a shared snapshot every content process receives at launch;
string preferences don't go through that snapshot unless explicitly allowed
through, and the failure mode is an empty string with no error rather than
anything that points at the cause.

Framed around what people actually hit this on - a spoofed string value,
not a flag or a number - since that's the case where "it works in
about:config but the page sees nothing" costs the most time. The existing
FAQ entry ("does about:config show the truth... not always what a content
process is using") already gestured at this without explaining the
mechanism; this section is what it was gesturing at.
2026-07-28 20:45:50 +02:00
feder-cr 52591e5524 docs: a measured example of noise failing a single-read check, not just a two-read one
Strengthens the existing "why substitution instead of noise" argument with
a concrete case found while mining 22-patch-port-history.md: an earlier
iteration used small per-pixel noise on WebGL readback specifically, and a
masking-detection check flagged it directly from a single read, because the
noise had a distinct high-frequency statistical signature rather than
needing two reads compared against each other. Replacing it with a
per-channel remap that resembles an ordinary GPU colour-profile difference
took a measured spike count from about 320 to near zero on the same probe.
Same lesson the rest of the article already makes, now with a number behind
it instead of just the reasoning.
2026-07-28 20:40:28 +02:00
feder-cr 9d21ce019b docs: prep_recaptcha was shipped and completely undocumented
Found while mining 22-patch-port-history.md: the wrapper has had a
prep_recaptcha=True parameter for a while - a real, tested feature
(29 unit tests internally) with zero mention anywhere on the site,
including Configuration, which is exactly where it belongs.

Added it in two places. Configuration.md gets the actual usage: the
parameter, what it does in one paragraph, the profile_dir interaction that
disables it automatically, and a pointer to the mechanism page.
recaptcha-v3-score.md gets a new section instead of just the parameter,
because there's a real engineering story behind why this lives in the
wrapper and not the engine: the first attempt wrote the cookies once in C++
before any page loaded, compiled and linked cleanly, and did nothing -
browser.new_context() gives each context its own isolated cookie jar, so
state written before a context exists has nowhere to land. Generalised and
cross-linked to playwright-proxy-per-context.md, since it's the same
isolation mechanism that separates proxies and storage between contexts.
2026-07-28 20:29:34 +02:00
feder-cr f93163d1ef docs: the font cross-platform fix, applied to canvas and WebGL pixels
Same shape as bundled-fonts-cross-platform.md, different surface: a
GPU-backed render target can crash rather than return data if read directly
in-process, which rules out patching the render itself. The fix intercepts
at readback instead - the small, enumerable set of export calls (toDataURL,
toBlob, getImageData, readPixels, the createImageBitmap chain) is the only
place content ever actually sees the pixels, for both canvas-2D and WebGL.

Kept the masking-safe design decision from the existing canvas noise
article explicit here too: a near-uniform reference probe (the kind a
masking-detection scanner uses) survives untouched, high-entropy real
renders get the full substitution, which is what stops a masking check from
immediately noticing every readback is intercepted.

The proof that generalises past "looks plausible": same seed, same canvas
and WebGL hash, byte for byte, on Windows and Linux, verified against a
commercial fingerprint scanner across multiple seeds with zero failures on
either OS - a stronger claim than a fingerprint that merely looks
consistent.

Named the honest limit at the end rather than implying completeness: this
is an enumeration problem by nature, and newer export/capture APIs need
their own coverage as the platform grows - stated generically, no specific
list of what is or isn't covered yet, consistent with the rule that an open
gap in our own shipped surface doesn't get a public roadmap.

Wired into Canvas/WebGL/Fonts/Audio (nav_order 9), cross-linked from
canvas-fingerprint-noise.md's existing consistency argument.
2026-07-28 19:46:05 +02:00
feder-cr 4fc723ae36 docs: the mouse-movement fix that had been testing the wrong call
New article, cross-linked from human-mouse-movement.md. The finding: a
humanized path validated against page.mouse.move() and the same path used
through page.hover() are not the same test, because hover's hit-target check
moves the pointer before the humanized dispatch runs and consumes almost all
of the distance first. Measured interleaved on the same page: 108 events on
a direct move() call, 3 through hover() - a teleport with two extra samples
on it, on the exact call almost every real script uses (hover, click,
dblclick, check all share the same path).

Two more measured fixes bundled in, because a good macro fix doesn't repair
what the stroke itself gets wrong: a +0.4976px systematic jitter bias
(should be zero-mean, now 0.00039px) and a duplicate-position rate measured
at a page-side listener instead of the planned path, which is the
methodological point as much as the number - 0.706 on the planned path,
0.069 measured where a detector would actually be counting.

Named what's still open rather than implying it's solved: idle-time
distribution and endpoint-always-clickable are macro-level patterns no
single stroke fix touches, stated generically since it's a property of
click-driven automation generally, not specific to one implementation.

Wired into The Automation Layer category (nav_order 8, no collisions).
2026-07-28 19:38:29 +02:00
feder-cr a483b73e3d README: the environment-variable table described things nobody does
Every row was something this package does by itself. It downloads the engine on
first use, verifies a sha256, caches it, and picks a cursor engine. None of that
is a step somebody takes, so a table of overrides in the README asks a reader to
hold five knobs in mind before they have run anything.

It was also the third copy: docs/configuration.md documents all five and
docs/installation.md two of them. The right home for an override is the
configuration page, which is where somebody looking for one goes.

The test that covered the table was covering the wrong artifact, and its subject
had already moved once. It hardcoded four names and asserted the README mentions
them, so with the section gone it failed on the README rather than on anything
real. It now reads the list OUT of docs/configuration.md and keeps the property
worth keeping: a documented knob that no shipped module reads is worse than an
undocumented one, because the reader sets it, sees no effect, and stops trusting
the page.

Deriving the list also fixed a gap the hardcoding hid: there were five knobs and
four rows, so a fifth could have been documented and read by nothing. Two
mutations: a variable removed from the page (the collapse guard fires), and one
documented that nothing reads.

424 passed.
2026-07-28 19:36:03 +02:00
feder-cr c464c11260 fix: jekyll-readme-index did not actually fix the root 404, use a real index.md instead
The previous commit added jekyll-readme-index to plugins: and the build
reported success, but the bare root still 404'd - it is evidently not on
GitHub Pages' safe-mode plugin whitelist here, so it silently did nothing
rather than erroring.

Removed it and did the reliable thing instead: docs/index.md is now the
actual homepage, with the exact content docs/README.md carried before.
docs/README.md is now a short pointer at the published site, kept only so
browsing the folder directly on github.com still shows something sensible
rather than the old full homepage duplicated in two places forever.
nav_exclude + search_exclude on it so it does not show up as a redundant
second "home" entry in the sidebar or search results.
2026-07-28 19:12:40 +02:00
feder-cr 895ea47176 fix: the bare site root 404s, and nobody had ever checked it
Every individual page built and served fine after the restructuring push -
verified guides.html, documentation.html, comparisons.html, README.html and
several article pages all return 200. Only the bare domain
(feder-cr.github.io/invisible_playwright/) and index.html returned a GitHub
Pages 404. Pre-existing, not something the restructuring introduced: nothing
in this project's verification history ever curled the root URL, only
specific article links, so a homepage that never worked went unnoticed.

jekyll-readme-index (part of the github-pages gem's plugin whitelist) is not
active by default the way jekyll-sitemap and jekyll-seo-tag are - it has to
be listed explicitly to serve docs/README.md at the root when no index.md
exists. Added it rather than adding an index.md, since docs/README.md
already carries the front matter and content the homepage needs.
2026-07-28 19:05:48 +02:00
feder-cr a33fc26f03 site: real sections instead of one flat sidebar, plus the product docs that were missing entirely
The site read as a pile of articles, not a site for this project specifically,
because docs/ only ever held the guides - everything about installing and
using the package lived exclusively in the GitHub README, which is not a page
on the published site at all. Anyone who landed on an article from a search
had nowhere to click for "how do I install this."

Five top-level sections now, all via just-the-docs' native parent/has_children
front matter, not folders - no URL changes, no broken links:

- Documentation (new): Installation, Quickstart, Configuration, Pinning
  fingerprint fields (existing page, re-parented), CLI reference. Adapted from
  the README's own Install/Usage/CLI content rather than duplicating it
  verbatim, since these needed to stand alone as pages rather than sections.
- Guides: the 48 existing explainers, grouped into 7 categories instead of one
  alphabetical list - Browser Identity (15), Canvas/WebGL/Fonts/Audio (8),
  Network/Proxy/WebRTC (7), The Automation Layer (7), AI Agents and Frameworks
  (3), Detectors Explained (5), Testing and Troubleshooting (3).
- Comparisons: the 7 "vs" and engine-choice articles, promoted to their own
  section rather than buried inside Guides, since "which tool" is the most
  direct search intent this site gets.
- Integrations: unchanged content, promoted to a top-level section; its 9
  pages had no front matter at all until now, so they also pick up real
  per-page titles/descriptions for the first time.

Each new category page is a real intro, not a bare index: why the group holds
together, not just what's in it.

Also fixed: docs/_config.yml's header comment still said "deliberately no
front matter on the pages," which stopped being true on 2026-07-27 when every
page got title/description front matter for its own meta description - the
comment now says why front matter exists and what it costs (a rendered table
on github.com) rather than the reversed decision. docs/README.md and the
top-level README's guide list were both cut down from a 40+ entry flat table
to pointers at the four new sections, since the sidebar and category pages
now do that job.

Verified: every parent/grand_parent reference resolves to a real page title,
every has_children page is referenced by at least one child, no broken
relative links, no forbidden vendor names, no secrets, title==H1 on every
page including the 15 new ones.
2026-07-28 18:51:02 +02:00
feder-cr 6370041c09 ci: a publish was racing its own verification
user-install.yml runs on `release:`, which fires seconds after twine finishes,
and PyPI does not serve a new version to pip immediately. Measured today:
invisible-firefox 0.2.6 was uploaded, the release created about forty seconds
later, and the pip install in that job still resolved 0.2.5. So the run reported
a forgotten publish that had happened two minutes earlier - the most expensive
shape of red there is, because it is indistinguishable from the real defect this
workflow exists to catch.

A bounded wait on the PER-VERSION endpoint, five minutes, scoped to the release
event. The aggregate `info.version` lags it by minutes and has its own trap, so
the poll asks for the exact URL. Scheduled and dispatched runs do not wait: they
are not racing anything, and waiting there would hide a real absence behind five
minutes of polling. It is bounded because an unbounded wait turns a genuinely
forgotten publish from a red run into a job that hangs to the runner timeout.

In the workflow rather than in the four install-e2e test files: the race exists on
one event, and those files cannot import a shared helper - the runner has no
invisible_core, on purpose. A test in the core asserts all three workflows have
the step, that it is scoped, and that it has a deadline. Three mutations, all
caught.
2026-07-28 17:47:52 +02:00
feder-cr 8497a980c4 ledger: 0.4.8 2026-07-28 17:28:55 +02:00
feder-cr d33361c862 release: 0.4.8 - the pin follows the core, and F821 found three names that resolve nowhere
The core moved to 18.9.0, which carries a clearer engine refusal (it used to
locate a missing juggler inside an omni.ja the tree does not have) and a publish
gate that no longer reports a mistyped command with the same exit code as a
broken gate. An exact pin means those reach a user only when this package's pin
moves, so this release is what delivers them.

The rest is this package's own, and none of it was findable by running tests.
Nothing here had ever run a linter. The first F821 pass found:

Renderer, used as an annotation six times in _behaviour.py and defined in no
module in the repository. It survives only because `from __future__ import
annotations` never evaluates an annotation, so the six were strings that looked
like a type - and a reader had no way to learn what the parameter accepts. It is
a real alias now, describing the one call site.

prof: Any in _motion.py, with Any unimported. Importing it would have widened
that module's deliberately tiny allowlist, which one of its own tests enforces -
and there was no need: prof is the cumulative distance table _profile_table
returns and _profile_at consumes, both annotated list[float] two functions away.

And a duplicate `import pytest` in a test file, which is only noise but is the
third thing nothing was looking for.

CI runs ruff with F821 and F811 selected, those two only: they catch a name that
cannot resolve, and neither is a style question. Zero violations here once the
three above were fixed, so it is a gate rather than a backlog.

423 passed. e2e 139 green on a real browser against the pinned engine,
CONSISTENCY PASS, ALL CRITICAL FLAGS CLEAN.
2026-07-28 17:28:31 +02:00
feder-cr 297e10d641 six annotations named a type that exists in no module
The first F821 run this repo has ever had found three things, all of them
invisible to the suite.

`Renderer` was used as an annotation six times in _behaviour.py and defined
nowhere at all. It survives only because `from __future__ import annotations`
never evaluates an annotation, so the six were strings that happened to look
like a type - and a reader had no way to learn what the parameter accepts.
It is a real alias now, describing the one call at line 346.

`prof: Any` in _motion.py had the same shape with an extra twist: `Any` was
also unimported, and importing it would have widened that module's deliberately
tiny allowlist, which one of its own tests enforces. No need - prof is the
cumulative distance table `_profile_table` returns and `_profile_at` consumes,
both annotated list[float] a few lines away. Naming it costs no import.

And a duplicate `import pytest` in test_launcher_config.py, which is only noise
but is the third thing nothing was looking for.

CI runs ruff with F821 and F811 now, those two only: they catch a name that
cannot resolve, which is not a style question and not findable by running tests.
Zero violations here once the three above were fixed. 423 passed.
2026-07-28 15:37:13 +02:00
feder-cr b2ffb14564 the install e2e imported a package the runner does not have
user-install.yml installs pip, pytest and packaging on the runner and nothing
else, deliberately: the package under test goes into a venv the fixture builds
from the index, and a second copy on the runner's path would mean every
assertion read the wrong one.

Both files here imported the venv helpers from invisible_core.testing, where
they moved so the three suites could share them. On a development machine that
is fine - an editable install is always on the path. On the runner it is
ModuleNotFoundError at COLLECTION: the job goes red having tested nothing, and
the message names a module instead of the mistake.

So the helpers are local again in these two files, with the reason written above
them. The duplication is the point, and the core's suite now parses every file
the user-install workflows name and refuses the import, so it does not depend on
that comment being read.

Verified the way it should have been the first time: a venv holding only pip,
pytest and packaging collects both files from this repo's root. 12 tests
collected, 423 passed in the ordinary suite.
2026-07-28 14:57:09 +02:00
feder-cr db1422fe41 ci: arm the hooks, because the suite asserts they are armed
The reminder that core.hooksPath must point at .githooks moved into
invisible_core.testing so all three repos could make it, and all three started
making it. Only the core's workflow ran install_hooks.py - it had needed that
step since the day its own copy of the test was written - so this repo went red
on every push, on all four matrix legs, with a message about an unset config
that reads like a developer's mistake rather than a missing CI step.

A GitHub checkout is a git work tree, so the helper's "skip outside a git
checkout" guard cannot cover this, and it should not: the honest arrangement is
for CI to do what a developer does once. It also means install_hooks.py is now
exercised on every leg instead of only on the one machine that ever ran it by
hand.

The comparison that was missing is in the core's tests now, so a fourth repo
adopting the assertion gets told about the step in the same run.
2026-07-28 14:22:08 +02:00
feder-cr 4b44acb49b docs: the Playwright wire protocol, and the release that broke 97 of 133 tests
Mined 30-upstream-playwright-patches.md, a source file not touched by any
earlier batch. Unlike the WebRTC/proxy deep-dive just done on request, this
one had genuinely new, safe material: a closed and validated fix rather than
an open bug, and about the driver/client contract rather than fingerprinting
or detection at all, so it doesn't carry the same disclosure risk.

The story: Juggler's command schema is closed-world, rejecting any
undeclared field at the moment a specific API is called rather than at
launch. A Playwright client release added fields to two viewport commands;
the first was patched by hand and felt like the fix, the second alone took
out 97 of 133 end-to-end tests in one run because every test builds a
context and only context-with-screen-size triggers that field. A bare
launch probe never sets a screen size, so the shallow check stayed green
throughout - the same shallow-probe-vs-real-usage gap the site's testing
article already names in a different context.

The decision worth keeping is declare-and-ignore over declare-and-honour:
accepting the field stops the rejection, but using its value would let a
client silently overwrite a screen dimension the fingerprint profile owns
for consistency reasons - the same principle pinning.md documents about
correlated fields. Closes on the gate that makes this repeatable: diffing
the client's actual wire behaviour against the declared schema in both
directions, validated by deliberately breaking it and confirming it flags
the break.

Wired into both indices; cross-linked from vs-patchright.md, since it's the
other half of "what Playwright's driver-side contract with Firefox breaks
on," unrelated to the CDP-specific tells that page covers.
2026-07-28 08:58:43 +02:00
feder-cr 70c8028214 README: the engine section was telling people about a step they never take
It opened with megabytes and a cache directory, which is what the download
does, not what the reader has to do about it. Both numbers were already on the
install line four sections up, so the section's whole first half was a second
copy of a figure that only has to stay right in one place.

What is actually useful there is the list of situations where you override
something - another drive, a binary you already have, a network that refuses
anonymous downloads - so that is what the section is now, said in those terms
rather than as "what it does". The heading says environment variables, because
that is what a reader looking for this would search for.

The sizes stay on the install line, where test_the_stated_download_size_matches
_the_sealed_assets derives the acceptable band from seal.json and refuses a
figure that has drifted.
2026-07-28 08:39:57 +02:00
feder-cr e860f8ff8c docs: close out the contextual-link pass, eight pages were still at zero
Found while re-measuring: these eight pages had a relative link somewhere
in the file, but every one of them was inside the FAQ block or the See-also
footer, not a genuine in-body link inside a main section. Footer and FAQ
links carry a fraction of the SEO weight a contextual in-body link does, so
by the density measurement these were still effectively at zero, same as
pages with no link at all.

One link added per page, each anchored to text already in the sentence
rather than a sentence built around a keyword: eval_length to the
toString-source page, the debugger-timing value-vs-behaviour point to the
renderer-string-vs-render page (same lesson, different surface), the
FingerprintJS component list to hardware-concurrency-device-memory, the
cdc_ page's "wrong question" line to the stealth-levels map, canvas
image fingerprinting's font-stack dependency to the bundled-fonts
architecture page, the measureText page's own opening line to
canvas-fingerprint-noise (it already named canvas fingerprinting in
prose), WebGL's ANGLE explanation to the numeric-parameters page, and
pinning's storage-quota mention to the hardware-concurrency page.

Re-measured after: all 55 pages now have at least one genuine in-body
contextual link, zero broken relative links, zero forbidden unicode.
2026-07-28 08:39:09 +02:00
feder-cr c18d5cf4f1 release: 0.4.7 - the pin reaches the index it moved to
The repo pinned invisible-core 18.8.0 and the index still served a wrapper
pinned to 18.6.0, which is the forgotten-publish state this project has a
test for. Nothing in this package's behaviour changed; what changed is which
core a fresh install resolves.

18.8.0 carries the prefs builder split into fourteen named steps with its
output hash-identical across 400 profiles, the GeoIP fetch out of download,
invisible_core.pin as a public module, and a publish gate whose index
cross-check asks about the package it is gating rather than always about the
core.

This package's own imports moved with it: it asks invisible_core for what
that package exports instead of reaching into its private modules, and its
back-compat shims are for users again rather than for its own source.
2026-07-28 03:56:43 +02:00
feder-cr 2e9feb1f86 the pin moves, and the shared helpers come back
Publish the core, THEN move the pin, THEN use the name. All three in order
this time, and this commit is the second and third: the pin names a core
release that is on the index and carries everything this package imports
from it.

The venv helpers are shared again - the local copies were what doing it in
the wrong order cost - and the two hook-wiring assertions no longer skip.

invisible_core._pin is invisible_core.pin here now. What was wrong before
was never the rename, only the order.

Verified against the PUBLISHED core in a bare venv, not against the editable
checkout, which IS the working tree and so cannot see this class of failure:
423 passed, 0 skipped.
2026-07-28 03:22:24 +02:00
feder-cr 23ca48db4c docs: measureText and TextMetrics, the fingerprinting surface with no permission prompt
Closes out this batch of docs mining. This one needed care rather than a
straight write-up: our own patch catalogue has a known, currently-open gap on
this exact surface (a self-consistency identity in the actual-bounding-box
fields that a multi-string probe can still catch), and that gap is
deliberately NOT in this article. Publishing the precise shape of an unfixed
weakness in our own shipped product is a different thing from noting a
competitor's gap or an architectural trade-off, and the honesty standard this
site holds itself to does not require handing out a detection recipe against
ourselves before we've closed it.

What the page does cover is genuinely closed and validated: the per-glyph
horizontal advance offset went through two iterations, and the first one's
mistake generalises past fonts entirely - noise that accumulates with input
length is not noise, it is a growing tell, and it measurably raised a
commercial scanner's tampering signal before the single-bounded-offset
version replaced it. The vertical metrics needed a different fix again,
because they come from a different code path than the shaper touches - not a
value that can be jittered convincingly, but one that had to be read from the
font's own metrics table to stop leaking a 1-3px host-OS delta.

Wired into both indices; links out to headless-fonts-differ.md,
bundled-fonts-cross-platform.md and canvas-fingerprint-noise.md.
2026-07-28 03:19:15 +02:00
feder-cr 4314909230 docs: front matter on the 32 pages that predated the format
Every one of these pages previously inherited the repository's own blurb as
its meta description on the live site, since jekyll-seo-tag falls back to
that when a page has no front matter of its own - the same problem the
format was adopted to fix on 2026-07-27, just not yet applied backwards.

Title is the existing H1 verbatim in every case (checked programmatically:
title equals H1 on all 32, all H1s already under the 62-character limit).
Description is a new sentence or two written from each page's own opening
hook rather than a copy of its first paragraph, since the two placements
serve different readers: the opening paragraph is for someone already on the
page, the meta description is for someone deciding whether to click.

No content changes to any page body.
2026-07-28 03:12:26 +02:00
feder-cr 283a959ab0 docs: the font architecture article, not just the symptom
headless-fonts-differ.md explains why fonts differ across machines. This is
the fix we actually shipped, and it earned its own page rather than a bullet
in that one: filtering a host's font list still leaves the host's rendering
underneath, which is a contradiction with extra steps rather than a fix.

The real content is the part nobody else documents - making three unrelated
font backends (DirectWrite, fontconfig, CoreText) agree on the same family
list from the same bundled files, without a shared enumeration mechanism
between them. Two details mattered more than the manifest format itself:
family naming has to follow the same precedence order a real OS uses, and
multi-face font files can't be indexed positionally across platforms since
face order isn't guaranteed stable everywhere.

Named four open gaps rather than claiming the surface is closed: one
backend's local() lookup isn't wired to bundle-only, one's per-glyph fallback
for an out-of-set character reaches the real host catalogue, one's system-ui
generic keeps a narrow live host query, and one platform's font-substitution
table stays host-live regardless of mode. Consistent with treating a
suppressed signal as a fail rather than a pass - these are real, found,
unfixed seams, not something glossed over for the page to read cleanly.

Wired into both doc indices and the README guide list, linked from
vs-camoufox.md's existing font section and from webgl-renderer-strings.md's
"same shape of problem" framing.
2026-07-28 03:05:22 +02:00
feder-cr 91a16d2fbd docs: three more comparisons, each one at a different layer
Patchright, nodriver/undetected-chromedriver, and playwright-stealth complete
the "vs" set against the tools already named in Related projects. None of
these three competes with this project the way Camoufox does - each sits at a
different layer of the same three-level map this site already uses, so the
honest framing for all three is "different job" rather than "which wins."

Patchright patches the Chromium driver, not the browser, so its fixes
(Runtime.enable, Console.enable, the automation-controlled launch flag) are
CDP-specific and have no Firefox equivalent - not because we solved them, but
because the surface they patch does not exist on this engine. Its own docs
admit init-script timing attacks remain and it passes "most, but not all" of
the Playwright test suite.

nodriver and undetected-chromedriver are not Playwright tools at all - they
have their own API, which makes the real decision "leave Playwright or not,"
not "which produces a less detectable browser." undetected-chromedriver's own
README states plainly it does not hide an IP address or touch fingerprinting;
nodriver drops the chromedriver binary entirely and talks CDP directly.

playwright-stealth is the widest gap on this site: four lines of init script
against a browser fork. Its own actively maintained fork calls itself "a
proof-of-concept starting point" and says not to expect it to beat anything
but the simplest detection - which is an honest scope statement worth taking
at face value rather than arguing with.

Wired into both doc indices and README's guide list; added "Full comparison"
links from the three Related-projects bullets (Camoufox, Patchright, nodriver)
to their dedicated pages, and added playwright-stealth as a fourth
Related-projects entry since it did not have one yet.
2026-07-28 03:01:50 +02:00
feder-cr 45c4e44a7b docs: the comparison with the closest peer, written to be fair rather than to win
Camoufox and this project take the same approach on the same engine, so the
comparison is about how rather than whether, which makes it the only genuinely
comparable pair in this space.

Three decisions about how it is written. It says where Camoufox covers more,
which today is geolocation and Intl, and names our own weakness on the second
rather than omitting it. It marks two areas where their documentation does not
state something and I did not read their source, so no advantage is claimed
where none was verified. And it leaves out a personal circumstance of their
maintainer that turned up in the research, because that is not a comparison
point and using it would cost more credibility than it could ever buy.

The substantive difference is philosophy: rotate a plausible device from a
real-world distribution, or derive one deterministically from a seed. Neither is
better in the abstract, and the page says what each buys instead of picking.
Ours buys replay, which is why a failing run can be rerun exactly.

The ending is the honest one: run both against your actual target ten times and
compare the reports rather than the verdicts, because two hours of that beats
any comparison page including this one.
2026-07-28 02:35:16 +02:00
feder-cr 3d33d6edaf docs: Chromium is not Chrome, which is the argument the comparison was missing
Playwright ships open-source Chromium by default, per its own browsers
documentation, not Chrome. Chromium has no H.264, no AAC and no Widevine,
because those are the proprietary parts Google adds on top. Chrome, Edge, Brave
and Opera all have them, which is to say every browser a real person runs.

Two things follow. The capability set a default Playwright Chromium reports
belongs to almost nobody, so that cohort is largely developers and automation.
And the gaps are capabilities rather than values: a missing decoder is missing
machine code, so `canPlayType` for H.264 and a Widevine request through EME are
one line each and no property override can satisfy either.

Which makes the standard advice actively harmful here. Spoofing the user agent
to say Chrome converts an unusual browser into a provable contradiction on two
independent checks, rather than hiding anything. The branded channel closes the
gap and hands you a browser you do not ship, do not version and cannot install
in a slim container.

Firefox has no equivalent split, and that asymmetry is now a section in the
engine comparison, which argued four other points and not this one.
2026-07-28 02:19:34 +02:00
feder-cr c68c21896a docs: how we faked a WebRTC candidate badly, and the Firefox case with its cost
ICE candidate spoofing. Every guide stops at the address. A candidate is a
record with computed fields, it arrives at a particular moment, and it sits
beside other candidates that have to agree with it. We got the address right
immediately and shipped three other things wrong.

The priority was hardcoded to 0xFFFF, which is not an unusual value but one the
real code cannot produce, since that stack emits a narrow band around 32256 to
32704. One integer in the SDP saying the candidate was not made by the browser.
The foundation drifted between runs and sometimes collided with the TCP host
candidate's, which is a grouping no real browser makes. And the synthetic
candidate was emitted instantly, describing a STUN server in the same room,
where published detection guidance for this exact technique names round-trip
timing as the way to spot it.

The fix in all three cases was the same shape: stop fabricating values and start
calling the function the browser already uses, replacing only the field that has
to change. Plus the failure that was worse than any of them, where gathering
died silently behind a proxy and produced no candidates at all while a
negative-only gate reported success.

Firefox against Chromium. Four structural arguments for Firefox, including that
it has no CDP and no Client Hints pipeline, each stated with the half the
comparisons omit: our own automation layer had four artefacts of its own, and
not implementing Client Hints means you cannot then claim to be Chrome. Then
the argument against, which is that Firefox is a small share of real traffic and
rarity is what the rest of this documentation warns about. Anyone selling a
Firefox tool without saying that is not being straight.
2026-07-28 01:43:28 +02:00
feder-cr 80b790995b the suite-collapse tripwire was counting a suite that moved
All 419 tests passed on every leg; the CI step that failed is the guard that
refuses a run where the selection dropped most of the suite - `if passed <
600`. It was right to fire: it cannot tell "the tests moved" from "the
selection collapsed", and that is exactly why it exists.

The number was stale. 322 tests moved to invisible_core on 2026-07-27 -
they covered core modules through this package's back-compat shims, and six
real breaks in core code were surviving the core's own suite. Nothing
shrank; the tests are in the package they test.

Floor is 380 now, a little under the real ~420, with the reason written next
to it. It is a tripwire, not an assertion about how many tests exist.
2026-07-28 01:22:27 +02:00
feder-cr 642707c785 readme: fold the search section into Related projects
"If you got here from a search" was a list of queries dressed as prose, which
reads as bait even when the content under it is honest. Removed.

Related projects now carries the same information as a real section: the
neighbours split by engine, each with a sentence on what it is actually for and
how it differs, rather than a list of things someone might have typed. Patchright
and nodriver were named only in the removed block and now have entries of their
own on the Chromium side.

The keywords survive because they belong in the descriptions anyway. What does
not survive is the framing that announced them.
2026-07-28 01:21:59 +02:00
feder-cr 5e0830f3a3 docs: contextual links inside the prose, where they were only in the footer
Measured before changing anything. Excluding the See also block, the median page
had 0.8 internal links per thousand words and 26 of 54 had exactly zero, with
every link sitting in the footer. The guidance on this is blunt: contextual
links inside prose carry far more weight than boilerplate blocks, and the
working range is two to five per thousand words.

Thirteen pages fixed in this pass, each one linking a concept the sentence
already named. The rule applied, and the reason nothing else changed: if a link
needs a sentence written around it, that is stuffing rather than linking, so the
anchor text had to exist already. Two intended edits were skipped for that
reason when the phrasing did not match.

Median is now 1.0 and pages at zero are down to 13. The rest are queued rather
than forced.
2026-07-28 01:18:40 +02:00
feder-cr 0a21a8857a the same rule, applied to the test helpers - and two tests with hidden preconditions
Reverting the pin import fixed one name and I stopped there. make_venv,
run_checked and venv_python have the same shape: added to
invisible_core.testing today, not published, and this package pins the core
exactly - so CI resolved the index and failed at collection on all four legs.

Local again, with a note saying they come back out in the same change that
moves the pin. The two hook-wiring assertions skip with a reason rather than
failing, and the skip clears itself when the pin moves.

Running the suite the way CI does surfaced two more, both hidden
preconditions rather than the change:

test_seal_floor copied `pin.py` out of the INSTALLED core to build its stub.
A core published before today has `_pin.py` only, so eight tests died before
the stub existed. It copies whichever shape is there now, and asserts it
found one.

test_it_does_not_touch_a_process_with_a_different_token asserted that the
surviving session is exactly one pid. On Windows a venv's python.exe is a
redirector that starts the real interpreter as a child, so a spawn there is
two processes and both carry the token. It passed on CI and on a system
Python and failed from a venv - a shape users have, and the shape this
package's own e2e tests build. It now asserts what the docstring says: the
other session is still findable, and nothing reaped answers to its token.

Verified against the PUBLISHED core in a bare venv: 421 passed, 2 skipped.
2026-07-28 01:14:56 +02:00
feder-cr a630a23173 docs: the two worker surfaces, and the state that survives clearing cookies
Service workers. Two facts the privacy write-ups on this topic do not cover
because they are about automation rather than tracking. A registration and its
cache are a separate store with a separate lifetime, so clearing cookies leaves
them, and a reused profile carries workers registered by whoever used it last.
And blocking them, which several stacks do by default because an intercepting
worker complicates network interception, produces a browser that never
registers one, which a site using them can see. Also states plainly what
partitioning is: it separates a third party's view across sites, and says
nothing about two of your own sessions sharing a profile.

Web Workers. The clearest demonstration of why page-level patching has a
ceiling, and now with evidence rather than assertion. A worker is a separate
realm, so a redefined navigator property reports the real value there, and the
disagreement is a tampering finding rather than a hardware one. OffscreenCanvas
takes that to the most-used surface there is: protection that hooks the HTML
element's methods misses it entirely, because no element is involved. Engines
have shipped fixes for their own gaps in worker canvas protection, which is what
tells you the technique is in use.

Both articles end on the same two-line test, which is the one we would run first
on anything claiming to be undetectable, including this project.
2026-07-28 01:11:47 +02:00
feder-cr 3a79606701 docs: what a context does not isolate, and the permission that switches off WebRTC
Proxy per context. This is the pattern every guide recommends for rotating IPs,
and the consequence is never attached to it: a context isolates storage, not
hardware. Five contexts on five proxies share one canvas hash, one GPU, one font
set, one audio profile and one screen, because there is one browser process. So
you paid for five addresses and got one identity, and that identity is now in
five countries at once while the constant fingerprint links the sessions
together. It also creates the timezone mismatch on purpose: a zone resolved once
at launch belongs to the launch-time exit, so every later context carries the
wrong one. The page is fair about when the pattern is right, which is often, and
precise about when it is not.

Permissions. The two-line headless check that compares Notification.permission
against the Permissions API is the ask-twice pattern again, which is why it
outlived the bug that made it work. Beyond the mismatch, the set of states is
itself a fingerprint, and the automation instinct to grant everything so dialogs
stop interrupting produces a browser almost nobody has. On Firefox it does worse
than that: a persisted camera grant disables two WebRTC address protections for
that origin in every future session on that profile.
2026-07-28 00:52:16 +02:00
feder-cr ed942ac5ef an exact pin means this package may only use what is PUBLISHED
Same mistake as the manager, same day. I moved this package to
invisible_core.pin in the change that renamed the module in the core's tree,
and that rename carried no version bump - so the index still serves a core
with _pin.py and no pin.py, and this package declares invisible-core==
exactly.

CI red on both legs. The import floor said the right thing; the sequencing
was wrong, and I verified the message rather than the consequence.

Reverted to invisible_core._pin. Verified against the PUBLISHED core in a
bare venv - the pin floor loads and resolves the declared version - rather
than against the editable checkout, which cannot see this class of failure
at all.
2026-07-28 00:28:32 +02:00
feder-cr f7963bbb5f docs: how to test properly, and the headers a page-level patch can never reach
Testing. Most people open a suite, read the verdict and stop, and that method
cannot tell a working feature from an absent one. Ours could not either: the
WebRTC gate asserted that nothing leaked, which a dead feature satisfies
perfectly, so it stayed green while the shipped browser returned nothing on
every proxied page. The page turns that into a method. Assert presence rather
than absence, diff against a stock browser on the same machine instead of
reading a score, run it where you deploy and through the proxy you deploy with,
repeat it because the domain is not deterministic, and open the screenshot. It
also says what none of the suites cover, so a clean sweep is not mistaken for a
clean session.

Client Hints and Sec-Fetch. Three copies of one identity in Chromium, generated
from the same internal state, which is why changing the user agent string and
nothing else is caught by comparing headers that were sent before any script
ran. Firefox implements none of it, and that cuts both ways: nothing to keep in
sync if you are Firefox, and an unfixable contradiction if you claim Chrome.
Sec-Fetch is the less discussed half and describes how the request was
initiated, including whether a user gesture triggered it, which connects to the
activation an automation driver can announce by accident.
2026-07-28 00:16:40 +02:00
feder-cr a4dd630790 docs: the agent ecosystem in one verified page instead of eight thin ones
Checked five frameworks by reading their source rather than by star count, and
the result argued against the plan that produced it.

browser-use, Stagehand and Skyvern all drive Chromium over CDP, which Firefox
does not implement in the way those drivers expect, so an executable path
pointing at a Firefox build produces nothing. Stagehand documents the option and
still expects Chromium. crawl4ai is the one Playwright-based tool where Firefox
is genuinely selectable and it has no field naming a binary, so it is one field
away rather than one protocol away. Maxun exposes neither, which for a no-code
product is a decision rather than an oversight.

Writing that as eight separate articles would have been eight pages concluding
the same thing, which is exactly the padding the format is supposed to prevent.
One page with a section per project still matches each project's own query, and
it can carry the part that actually matters: none of this is what blocks most
people. Every machine-level tell is identical whichever framework was picked,
and a container has all of them at once.

Also records the agent-specific rhythm, which explains blocks arriving after a
few actions rather than at first load, and the MCP route, which is the one
combination that does accept a different engine today.
2026-07-28 00:08:32 +02:00
feder-cr e4bef53d1a docs: the two largest Playwright-driving projects, verified from their source
Both were checked before writing, and the check changed both articles.

browser-use, 107k stars. Its BrowserProfile does expose executable_path,
channel, user_data_dir, proxy, args and headless, so there are real levers. But
chrome.py is entirely Chrome executable and Chrome profile handling and the
channel type is a Chromium channel, so a Firefox binary is not a drop-in and the
page says so rather than inventing a workaround. What it adds instead is the
signal specific to this class of tool: an agent pauses for model latency, does
not move during the pause, and lands dead centre on its targets, which explains
blocks that arrive after a few actions rather than at first load.

crawl4ai, 75k stars. BrowserConfig accepts browser_type firefox and has no
executable_path at all, so you get Playwright's managed build and a patched
engine has no supported way in. Their own stealth mode is playwright-stealth,
which their documentation admits does not support Firefox, so that combination
is largely inert. The adapter seam does exist, on the crawler strategy rather
than on the config, and it is undocumented for custom adapters. Records the one
upstream field that would fix it properly, and the process-wide browsers-path
substitution that works today with its fragility stated.

Three of the six candidates from the star list turned out not to use Playwright
at all, which is why each of these starts with reading the source.
2026-07-27 23:57:36 +02:00
feder-cr 26acc297a4 ask the core for what it exports, not for its private modules
This package named eight of the core's modules directly, five of them
private, and reached four more through its own back-compat shims. Almost
every name it wanted was already exported by invisible_core itself, so it
asks for it there now. Private-module dependency across both consumers went
from 23 names in three modules to 6 in two.

Twenty imports in this package's own source went through the four-line
shims - `from .prefs import ...`, `from ._geo import ...`. Those shims exist
so that somebody's `from invisible_playwright import prefs` keeps working
after the 2026-07-03 split; production code depending on them means they can
never be removed, which is the opposite of what a back-compat layer is for.
It is also the same confusion that put 322 tests in this suite instead of
the core's. test_suite_boundaries.py now covers the source as well as the
tests, and was driven against a shim import put back to check it fires.

invisible_core._pin is invisible_core.pin. The import floor already reports
a core too old to carry it with the right message and the right remedy, so
this costs a stale environment nothing but a clear error.
2026-07-27 23:45:16 +02:00
feder-cr 15d68ffe44 docs: four more, in the structured format, each with its own meta description
CSS fingerprinting. The one surface that operates below every layer people work
at: a stylesheet can branch on pointer type or colour scheme and report the
answer by loading a different image, with no script to patch. Two traps follow.
Firefox resolves media-query sizes through different code than screen.width, so
spoofing one side leaves them contradicting each other. And the CSS system
colour keywords resolve through the host's own theme, so a Linux machine
claiming Windows returns the wrong palette from one getComputedStyle call. That
palette is pinned here because a detector was hashing it.

Codecs. canPlayType identifies the build and the platform, and MediaCapabilities
adds a field nobody checks: powerEfficient reports whether decoding would be
hardware accelerated, which is another way of asking whether this is a person's
computer or a server.

BFCache. The driver disables the back/forward cache, so pageshow.persisted is
always false and every back navigation is a full reload, which no consumer
browser does. Enabled by default here, with the go_back timeout that costs.

User agent. Argues against what every ranking result recommends. Rotating the
string does not rotate the browser: the canvas hash, the fonts, the renderer and
the handshake are identical between your "different" sessions, so rotation
produces contradictions and a stable identifier linking the sessions at once.
2026-07-27 23:09:31 +02:00
feder-cr 4414a4fb48 docs: persistent profiles, and the first page with its own meta description
Three traps behind a user data directory. The seed has to be paired with the
directory, or the session has weeks of history on hardware that changed
overnight. A stored camera permission switches off two separate WebRTC address
protections for that origin in every future session on that profile, and it
counts a persisted grant rather than an active capture, so a debugging call from
months ago still applies. And a written profile has to be internally consistent
about its own age.

This is also the first page carrying front matter, so it gets a description of
its own instead of the repository blurb every page currently shares. The title
is set identical to the heading so the existing mechanism does not regress,
which is the thing to verify before applying this to the rest.
2026-07-27 22:58:38 +02:00
feder-cr caa263fbf1 docs: five more, one keyword pass each
Execution context was destroyed. The most searched Playwright error, answered
everywhere as a race condition, which it usually is. It is also what you get
when a site redirects you to a challenge mid-evaluation, and the two are
indistinguishable from the stack trace. Four lines separate them: read the URL
and take a screenshot when it fires.

The debugger one is the story you asked for. Attaching a JS debugger calls
setIsDebuggee on every realm, which disables the optimising JIT and adds a slow
path to every native call. A commercial service was measuring 50,000 iterations
and reporting developer tools with none open. It was right. Four separate leaks
in the end, and the one that mattered was not timing at all: the driver warmed a
serialisation helper in the page's own realm before the page's first script,
touching JSON and two prototypes in a world that should have been untouched.
That one was proven by controlled experiment.

Browser extensions, which came out of a discussion question that had been
answered by a stranger talking about a different kind of extension entirely.

Headless versus headful, where the honest answer is that headlessness is rarely
what gets detected, and where this project's headless flag actually launches
headed and hides the window, three different ways by platform.

WebGL parameters, which contradicts the most repeated advice in the field. The
numbers do not vary by GPU on Windows, because ANGLE clamps them to the D3D
feature level, so a flagship and a 2012 integrated chip return the same block.
We randomised them once and got dropped from a detector's report for producing
a combination that does not exist.
2026-07-27 22:50:05 +02:00
feder-cr c341ada26a docs: why a fresh browser scores badly on reCAPTCHA v3
The score is weighted toward history, and a clean automated profile has none.
That is not a trick to be worked around, it is the thing being measured: a
session with no past is genuinely unusual, and the number reflects the base
rate.

The part worth publishing is the trap rather than the advice. A cookie Google
stopped issuing in 2022 is worse to carry than to lack, because absence has
innocent explanations and an anachronism does not. Anyone seeding a profile from
an article written before that date is adding a tell, and seeded history has to
be maintained rather than written once. Also covers the consistency angle
nobody checks: the consent record carries a region token that has to agree with
the timezone and the exit.

States the limits plainly, since scores invite overclaiming. Cookies are one
input, a seeded history is not a real one, and a demo key measures a risk model
that is not the one in production.
2026-07-27 22:24:26 +02:00
feder-cr e840df51cc docs: Docker, the machine's own numbers, and why an override carries its source
Docker. Every page that ranks for this is about making Playwright start in a
container: install the dependencies, add the fonts, use the official image. They
are right and they answer a different question. This one is about the container
that starts perfectly and still gets a different page, which it does in six
places at once, none of them about automation. It also says the thing nobody
says about the official image: everyone following that advice has the same font
set, which is a cohort rather than a disguise. And it separates the shared
memory crash from detection, because the two land in the same search and have
completely different fixes.

hardwareConcurrency, deviceMemory and storage quota. Three one-line reads that
are checked against each other rather than alone, plus the check that matters
most: ask again from a worker. A value patched on the page's navigator leaves
the worker answering honestly, and that disagreement is a tampering finding
rather than an unusual-hardware one. Storage quota is in here because it
approximates free disk space and almost nobody thinks of it as a surface.

toString. Why every JavaScript override carries its own source, why patching
toString creates the same problem one level up, and the four techniques that
find it. This is the argument underneath the whole engine-level choice, so it
also states plainly what that choice does not fix.
2026-07-27 22:19:58 +02:00
feder-cr 5a6cd97c9f docs: three more, each one going a layer below where the ranking pages stop
Same selection method: check the demand, then read who currently answers and
find the part they leave out.

Mouse movement. Every library that ranks draws a Bezier curve, and they are
right that teleporting is a tell. What none of them cover is that a path is made
of events, and an event carries fields that say where it came from: the trusted
flag, the pointer type, the pressure, the timing distribution. A perfect arc
delivered as untrusted events fails a one-line check. The curve is drawn in the
driver here; the fields are set in the engine, which is why that half is not a
library.

Canvas noise. The four-line check that catches per-call randomisation is well
known enough now that better tools seed their noise. The second check is not:
a small canvas filled with solid reference colours, read back to confirm they
are unchanged. Any per-pixel noise fails it, seeded or not, and it is scored as
masking rather than as unusual. We shipped without that guard. Also states the
cost of substitution honestly, which is that a readback filter cannot tell a
fingerprinting probe from a QR decoder.

Screen size. The relationships matter more than the numbers, and the one that
catches everybody is that available height must be smaller than height, because
real desktops have a taskbar.
2026-07-27 22:14:36 +02:00
feder-cr 93a89b1cba give the core its tests back, and gate the boundary
322 tests in this suite covered invisible_core, reached through the
four-line aliasing shims left behind by the 2026-07-03 split. They read
like wrapper tests because they lived here and the imports worked.

They were also the only thing covering six real behaviours. Measured, one
one-line break per core module, each suite run separately: cloak_prefs()
returning {}, SOCKS detection always False, the scheme never stripped from
a proxy server, _proxy_is_set always True, the locale always en-US,
get_default_args() injecting -headless - all six survived the core's own
suite and were caught here. So a broken core could be published with its
own gates green, and the suite that could see it belonged to a package on a
different release cadence.

The tests moved. Six files that genuinely test how THIS package uses the
core kept theirs and now import invisible_core directly rather than an
alias of it, which is what they always meant.

test_suite_boundaries.py is what stops the next one landing here. The shim
list is derived from the source - a module that rebinds
sys.modules[__name__] - because a hand-kept list is a shorter list that
drifts, which is the failure being fixed. test_backcompat.py is the one
file still allowed to import them: proving the shims resolve is a wrapper
claim, and the day that stops being true is the day the shims can go.

Its own first cut used glob instead of rglob and passed over tests/unit/,
which held the only cover get_default_args had anywhere - a scan that only
looks where you remembered to put things reports a clean suite.

Markers: one vocabulary across the three repos, --strict-markers on, and
the venv harness now comes from invisible_core.testing instead of a fourth
local copy of the same two functions.
2026-07-27 22:08:44 +02:00
feder-cr 514445ba03 docs: two pages where the top search results are giving wrong advice
Both chosen by checking demand and then checking who currently answers, not by
picking topics we felt like writing.

SOCKS5 proxy authentication. The guides that rank say to pass a socks5:// server
with a username and password and that this works. Playwright's own API reference
scopes both credential fields to HTTP proxies, in those words, while listing
SOCKS only under the server field, and the upstream feature request for SOCKS
authentication has been open since November 2021 with 49 votes and a
collecting-feedback label. Nothing raises when you pass them anyway, which is
why the wrong advice survives: it fails later, as a session that quietly went
out from the wrong address. Also documents the DNS half, since a SOCKS proxy
resolves names locally unless told not to, and no browser-side leak test shows
that.

TLS fingerprinting. Explains what the ClientHello gives away, why JA3 decayed
once browsers started permuting extension order, and why nothing at the page
level can reach a value that is sent before a document exists. Our position
here is unusual and worth stating plainly: the TLS stack is one of the parts we
deliberately do not patch, so the handshake is a real Firefox handshake rather
than an approximation, and the page says what that does not buy you.

Both carry the question block and both are wired into the two indexes.
2026-07-27 22:08:03 +02:00
feder-cr be3c6e90e3 docs: give every page the questions people actually type
On github.com these pages sit on a strong domain and are crawlable, and the full
text is served. What they cannot have is a title or a description of their own:
GitHub writes the title from the file path, and it fills the meta description
with the repository's own blurb, identically on all of them. So the body is the
only thing a search engine has to work with, and the opening prose is
effectively the description.

Two changes follow from that.

Every page now ends with a short block of real questions and short answers, in
the words someone would type. Twenty-two pages did not have one; four already
did, and those four were the model. They are answers, not keyword filler, and
several of them say plainly that the answer is no.

Five openings were too thin to serve as a snippet, the shortest being four
words. They now carry a sentence that says what the page settles, without
losing the line they opened with.

Also refreshed the version citations after checking them rather than assuming:
the documented API is all still present in 0.4.6 with compatible signatures, and
scrapy-playwright is still 0.0.48, so that one was already right.
2026-07-27 21:43:53 +02:00
feder-cr 195c962dde hand the pre-push rules over to invisible-core
This repo's hook was 257 lines of shell, 207 of which were identical to the
manager's. It is a 55-line stub now: find an interpreter, hand over stdin.
The rules live in invisible_core.hooks, which this repo pins exactly, so
there is one implementation instead of three copies that drifted nine ways.

What this repo wants gated is declared in pyproject under
[tool.invisible.hooks] - the suite, the core pin, and v* as the release tag
prefix. The block is required rather than defaulted.

scripts/install_hooks.py is new here. It lived only in the core, so this
repo shipped a hook that nothing armed and nothing checked was armed: a
fresh clone pushed with every gate inert and said nothing about it. A test
now fails in an unarmed clone.

test_the_pre_push_hook_gates_release_tags used to read the hook's text for
a module name and a tag pattern, which made it a copy of the shell it was
checking - red once when the hook swapped a glob for a regex, red again
when the policy moved out of the shell, both times against a correct hook.
It drives the real policy now and checks the gate ran for THIS project.

.gitattributes pins the hook to LF so a Windows clone cannot produce a
shell script its own shebang dies on.
2026-07-27 21:02:43 +02:00
feder-cr b7bfb36452 fix(hooks): set -e killed the hook on the gate's no-op exit
The gate exits 5 for ALREADY PUBLISHED and byte-identical - a no-op, not a
refusal, and what re-pushing a release tag legitimately produces. These hooks
run under set -e, so the non-zero exit aborted the script before $? could be
read: the push died with no message at all, and the block that exists to explain
a refusal never ran.

A gate that fails silently is worse than no gate. Wrapped in an if, which is the
form set -e tolerates.
2026-07-27 19:56:17 +02:00
feder-cr 763d74aba6 docs: close the last gaps in the internal link graph
Measured it: 14 of 26 pages had no incoming link from any other page, only
from the two indexes, which is a weak graph for a reader following a thread
and for anything crawling it.

Six of those were explainers, and each one had an obvious home. The audio page
belongs in the visitor-ID page's neighbourhood because the audio hash is one of
the components that ID is made of; the timezone page belongs next to the one
about preferences that silently do nothing, since that is why people arrive at
it. No explainer is orphaned now and no markdown link is broken.

The integration pages stay linked from their own index rather than from each
other, which is the right shape for them.
2026-07-27 19:42:56 +02:00
feder-cr c1911ac28f fix(hooks): the publish gate never actually ran
--project-root is a TOP-LEVEL option, before the subcommand. The hook put it
after, so argparse exited 2 and the block read that as a refusal: it printed
REFUSED with the gate never having executed. The first check of this wiring
passed on exactly that, which is worse than no gate - a hook that refuses for
the wrong reason is one people learn to force past.

It also treated exit 5 as a failure. 5 is ALREADY PUBLISHED and byte-identical:
nothing to do, not a refusal, and it is what re-pushing or back-filling a
release tag legitimately produces. The gate gives it its own code precisely so a
caller can tell it from 'the content changed under an unmoved version', which
must stay fatal.

The wiring test now asserts the option order and the exit-5 handling, because
both were invisible to the version that only checked the gate was named.
2026-07-27 19:41:34 +02:00
feder-cr e490078927 release: 0.4.6 - published through the gate, not through twine
The first release of this package that went out the way every release should:
the gate built the artifact, digested it against the ledger, uploaded the bytes
it had just built, and recorded them. A stale directory can no longer be the
thing that ships, which is exactly how 0.4.4 went wrong.

Requires invisible-core 18.6.0, which is where the gate lives.
2026-07-27 19:30:03 +02:00
feder-cr 5f78593e53 docs: the audio feature we removed, and why setting the timezone is not enough
Two more pages written out of our own notes.

The audio one carries a result that argues against the standard advice. We
added seeded noise to the rendered audio buffer, guarded it so it never
appeared in a buffer that should be silent, and a commercial service still
scored the browser as tampered. Isolating that one feature with a kill switch
moved the score from 0.4349 to 0.0564 on the same machine and the same
identity. So it ships off. The un-noised output is host-independent anyway and
matches what a real Firefox produces, and matching the crowd is the point when
the honest value describes a class of machine and not a particular one.

It also records the check that caught the first version: a detector does not
have to recognise your noise, it only has to ask a question whose correct
answer is nothing, and see whether it gets something.

The timezone one is about a complaint we have heard often, which is that the
setting appears to be ignored. Usually it is not: the timezone and the locale
are nine surfaces fed by different mechanisms, and a mismatch check compares
them with each other and with the exit address. Includes the Windows TZ
behaviour, which took us several rounds to stop misreading, and the argument
for failing a launch rather than falling back to the host zone when a proxy is
configured.
2026-07-27 19:18:32 +02:00
feder-cr 42a7af8750 chore(release): this package could be published with no check at all
Until now a release here was a bare `twine upload` of whatever happened to be in
a directory. That is how invisible-playwright 0.4.4 reached the index built from
a tree that predated the fix it was meant to carry - nobody had opened the
artifact - and a PyPI filename is never re-uploaded, so it is wrong forever.

The gate is invisible_core.release now: one implementation for all three
packages, importable because this package pins the core exactly, resolving WHICH
project it is gating from this project's own pyproject. The pre-push hook runs
it on a release tag and refuses on a non-zero exit.

What makes it work is not the digests or the ledger. It is that `publish` builds
and uploads WHAT IT JUST BUILT, so a stale directory cannot be the thing that
ships.

PUBLISHED.json is back-filled from the artifacts the index actually serves, each
file's sha256 checked against the digest the index reports before its manifest
was taken. Without it the gate has no memory, and a content change waves itself
through as "release 1".

The wiring tests assert that the gate is importable, that it recognises THIS
project rather than the core, that the hook names it, and that the ledger is not
empty. The gate's own 73 known-bad inputs live with the gate.
2026-07-27 19:11:44 +02:00
feder-cr 42467ddb57 docs: titles that fit in a search result, and README links that feed the site
Thirteen of the twenty-six headings ran past sixty characters, which is roughly
where a search result stops showing them, so the keyword sat in the part nobody
reads. They are now front-loaded and short, and the clause each one lost was
already in its opening paragraph. This fixes the sidebar at the same time,
since the theme takes its labels from the same headings.

The README's links to the pages now point at the site instead of at the file
view. The repo root is the highest-authority page we have and its README is
indexed with it, so those links are worth more pointed somewhere that has a
title of its own. The file view keeps GitHub's own title, which matches no
query, and it stays available for anyone reading in the repo.
2026-07-27 17:40:22 +02:00
feder-cr e5d7ac01a2 docs: give the site a real documentation theme, with search and the logo
just-the-docs, pinned at v0.12.0. It brings a sidebar, a client-side search
index built at page-build time, and a readable dark layout, and it runs on the
stock Pages compiler with no build step of ours.

No front matter was added to any page, and that is the point. GitHub Pages
always runs titles-from-headings, so each page's title tag stays the full
heading we wrote it for. A `title:` key would have taken that over and traded a
search-length title for a sidebar-length one, and it would have put a metadata
table above every page on github.com.

Logo and favicon now point at the project's own mark.
2026-07-27 17:33:53 +02:00
feder-cr 0993509fe3 release: 0.4.5 - 0.4.4 shipped without the import guard and cannot be corrected
0.4.4 reached the index built from a tree that predated the fix for the very bug
a user had just reported: an environment holding an older invisible-core fails
on the browser launch path with `cannot import name 'IANA_TO_POSIX_TZ'`, a
symbol name from a package whose version the reader did not choose.

A PyPI filename is never re-uploaded, so 0.4.4 stays wrong forever and the only
remedy is a new version. That is the cost of publishing an artifact nobody
opened first.

0.4.5 is 0.4.4 plus the guarded import: it states which core version this build
needs, keeps the original error inside the message for debugging, and ends with
the command that fixes it. The artifact was opened and asserted on BEFORE the
upload this time, not after.
2026-07-27 17:29:50 +02:00
feder-cr d10452a8ad fix: an old core failed with a symbol name instead of a version
Reported by a user within minutes of the change that caused it, on the browser
launch path:

  ImportError: cannot import name 'IANA_TO_POSIX_TZ' from 'invisible_core'

_session took two core symbols with a bare module-level import. Both had existed
for about ten minutes. Any environment holding an older core - and the pin
autofix puts older cores back on its own - died with a message naming a symbol,
from a package whose version the reader did not choose.

The pin machinery exists to explain exactly this mismatch, and a module-level
import walks straight past it. That is the actual defect: not sharing the
timezone table with the core, but taking a NEW symbol without making the failure
fail like the version requirement it is.

It now says which core version this build needs, keeps the original error inside
the message for whoever is debugging, and ends with the command that fixes it.

Nothing published was affected: 0.4.3 does not import these names. It is people
running from a checkout - which is who reported it.

The probe drives a real interpreter against a real core with the symbols
stripped, because the thing under test is what happens at import time; a mocked
ImportError would only prove the except branch formats a string. Mutation-tested:
restoring the bare import is red.
2026-07-27 17:07:07 +02:00
feder-cr 725a99f56f docs: publish the docs folder as a site, and give the index a real title
The Pages defaults already take each page's title from its own first heading
and rewrite the relative .md links to the built .html, so both sets of links
keep working. Checked live before writing any config. What was missing was a
sitemap and an index page whose heading was the word "Documentation", which
would have become the title tag of the landing page.
2026-07-27 17:01:24 +02:00
feder-cr 40ff6526a3 docs: publish the docs folder as a site, so each page has its own title
Turning on Pages without this would give all 23 pages the same title tag,
which is the opposite of the point. titles-from-headings takes each title
from the page's own first heading, relative-links keeps the existing .md
cross-links working in both places, and the sitemap lists the set.
2026-07-27 16:50:46 +02:00
feder-cr 1734797148 docs: WebRTC through a proxy, and why getVoices() comes back empty
Two pages written from our own notes and aimed at the questions people
actually type.

The WebRTC one argues against the advice every other guide gives. Turning
WebRTC off does stop the leak and produces a browser with no ICE candidates
at all, which is a much more specific thing to have said about yourself than
an IP address. It also records that the IPv6 preference everyone still
recommends is not read anywhere in the gathering path of current Firefox, and
that behind a SOCKS proxy gathering can fail for a reason unrelated to
WebRTC: the default-route probe needs direct connectivity and does not have
it. The gate story is ours. It asserted only that nothing leaked, which a
dead feature satisfies perfectly, so it stayed green while the shipped
browser returned nothing on every proxied page.

The voices one separates the common async question from the real one. The
list comes from the operating system, so it answers which OS you are on and
whether the machine is a desktop or a server. It also explains why filtering
the OS list is the wrong shape: it works on Windows and returns nothing on
Linux, which is the host it was written for.
2026-07-27 16:30:17 +02:00
feder-cr f3102de8fd docs: a page on the GPU you claim versus the pixels you draw, plus a language pass
Adds renderer-string-vs-render.md, written from our own notes: a detection
flag whose first explanation was wrong, killed by a ten-seed sweep across
three vendor buckets, an A/B over two engine builds and a run on a second
operating system that came back clean. The cause was the software rasterizer
on headless Linux contradicting the GPU the profile claimed. It also covers
the second flag in the same reports, which turned out to be our own test
harness hammering one exit address.

The rest is a pass over the existing pages to vary phrasing that had become
repetitive across the set: "rather than" appeared 63 times over 21 pages and
is now 23, and the four detector footers no longer share one sentence shape.
No technical claims changed.
2026-07-27 16:22:52 +02:00
feder-cr f6450a98cd docs: the per-platform font sets and how the measurement works, folded in
The remaining mapped query was fonts across Windows and Linux, and it overlapped
this page far enough that a second one would have been a near-duplicate competing
with itself. Same call as the injection-timing section a few commits ago.

What was genuinely missing is now here: the measurement technique itself, with the
probe, since there is no API that lists fonts and everyone says "enumeration"
anyway; the families each platform actually ships, which is what makes the set
platform-shaped; and the container case, where every probe returns the fallback
width and the detected set comes back empty, which is its own strong signal because
no real desktop has one.

Also notes that the order of the list can carry information, since some
implementations return fonts in system order, which reflects how they were
installed. Two machines with identical sets can still differ in sequence.
2026-07-27 14:23:04 +02:00
feder-cr 869a987d4a docs: why a FingerprintJS visitor ID changes
The answer is one line of their source: the ID is x64hash128 of the canonical
string of about forty-one components. There is no partial match, so one component
moving moves the whole identifier as if everything had.

Listed the components from src/sources and grouped them by how likely each is to
move under a real person, which makes the instability self-explanatory: docking a
laptop moves screen_frame, turning on dark mode moves forced_colors, installing any
application can move fonts, a browser update moves vendor_flavors and
user_agent_data, and travel moves three at once.

Then the part that matters for automation, which points the opposite way from the
usual assumption. An ID that changes between runs of the same configuration is a
signal rather than safety: real machines do not transform between page loads, and a
tool adding fresh canvas noise per read rather than deriving it from a fixed seed
produces exactly that instability and is detectable by it.

Separates the open-source library from the commercial one explicitly, because
passing one is not passing the other, and a claim about defeating browser
fingerprinting that does not say which was measured has said nothing.
2026-07-27 14:20:19 +02:00
feder-cr 591c9eb10c docs: what BotD actually detects, and why most of it is not about bots
Enumerated its twenty detectors from src/detectors and read the comparison logic
rather than the README, which is where the point is. Exactly one of the twenty,
webdriver, is the check everyone knows. A handful look for named tools. The rest
ask which JavaScript engine you really are and compare that against what your user
agent claims.

Two are quotable and settle the argument on their own. eval_length: if
eval.toString().length is 37 and the engine kind is not WebKit or Gecko, that is a
bot. product_sub: a browser claiming Chrome, Safari, Opera or WeChat must report
navigator.productSub of 20030107, where Firefox reports 20100101.

So the conclusion is uncomfortable for the most common advice in this space.
Spoofing a user agent alone is worse than not spoofing it, because the string is
the only part you changed and four other engine-intrinsic values now contradict it.
Being a real instance of what you claim passes this entire class for free, since
those values are not claims at all.

Ends by saying what passing does not buy: nothing about GPU plausibility, fonts
against platform, or timezone against IP, none of which BotD looks at.
2026-07-27 14:16:46 +02:00
feder-cr 2edefa2e24 release: 0.4.3 - the async path leaked, and the guard was adopting half a tree
Two defects, one of them not the one I went looking for.

THE KNOWN ONE. The lifetime guard added in 0.4.0 reached the sync entry point
only. Verified against the artifact the index serves: async_api.py in the
published 0.4.2 contains ZERO references to _reaper, _session_token,
_lifetime_guard or _bind_process_tree, while main has ten. So every async user
on Windows kept the entire leak through three releases, and the changelog told
them it was closed. That line now says which entry point it reached.

THE ONE THE MEASUREMENT FOUND. With the async fix in place I killed a runner
mid-session and counted browsers still carrying that session's token, which is
the only thing that settles this claim - 744 passing tests did not, because
nothing enters the context manager. Result: sync 0/0/0/0, async 2/0/0/2.

JobObjectGuard.bind had `if bound: break`: it adopted whatever existed at the
first instant anything existed, then returned. Windows adds later CHILDREN of a
job member automatically, but firefox.exe is a launcher stub that exits, so the
real browser is re-parented away from whatever got adopted, and anything
arriving a moment later escaped. The same code on both APIs; only their timing
differs, which is exactly what makes a race look like a working feature. It now
scans until a full pass adds nothing for a settle window. After: ten sessions,
zero survivors on both paths.

THE GENERATOR, not just the instances. The parity test that was supposed to
prevent this looped over a hardcoded three-name tuple, so it could only catch
the bug that had already happened. It derives the expected set from the sync
class now: a member added there and forgotten on the other side goes red with
nobody editing the test. The env-var check is stronger still - NEITHER class may
name an INVPW_/STEALTHFOX_ variable, they all live in _session - because the
first version credited the shared module to both and the mutation that puts
INVPW_TRUE_HEADLESS back into async alone SURVIVED it.

And INVPW_TRUE_HEADLESS, a documented variable, was read in the async class
alone: it applied or did not depending on whether you wrote `with` or
`async with`. Both now read it through _session.

_session.py holds what the two share: prefs, the launch environment, the
IANA-to-POSIX table (which async imported FROM launcher for no reason other
than that is where it was written first). _build_prefs was a method on one side
and the same twenty lines inlined on the other, identical calls in identical
order, differing only in their comments.

Also deletes _humanize_max_seconds, which had had no caller in src/ since the
cursor engine moved into this package while six tests kept it alive. Those
tests now assert the function the live path calls, plus one that ties it to the
arming path so they cannot drift back into pinning something dead.

Mutation-tested: the async losing the reaper, the knob going back to async-only,
a member appearing on one side, and `if bound: break` returning are all red.
748 tests green.
2026-07-27 13:55:56 +02:00
feder-cr b9b4fbf1d1 docs: the timing failure, folded in rather than given a tenth near-duplicate page
The mapped query list had a separate title for injection timing, on a phrasing
close enough to this page's that a second page would have split one answer across
two documents and competed with itself.

The technical point was genuinely missing though, and it is the one that explains
the most confusing symptom in this area: a patch has to run before the page's own
scripts, so checking by hand in a console always succeeds, and a page whose first
line captures the value keeps the original forever. You cannot un-read a value that
was already read. Headed and headless differ here not by injection order but by
timing, which is why a race won on a warm laptop is lost on a loaded CI box.

Ends where the page already pointed: a value decided inside the engine has no race,
because there is no moment before which it was something else.
2026-07-27 13:48:17 +02:00
feder-cr dacdb8b0c6 docs: Firefox preferences that silently do nothing
Five reasons in the order they actually happen, and the first one is ours. Firefox
has no schema for preferences: about:config will store my.invented.pref and nothing
reads it, nothing complains, and it sits in the profile looking exactly like one
that works. A typo, a rename after an upstream bump, or a pref that only exists in
a build you are not running all produce the same silence.

This repository shipped that. Seven tests pinned preference names the engine never
reads, asserted the names were written, and stayed green while the engine ignored
all seven. So the page states the rule that follows: checking a preference was set
is not a test, the check has to be that observable behaviour changed, read back
from the page rather than from the profile.

Then the four less interesting ones: build-time prefs that are compiled in,
user.js winning over prefs.js on every launch while prefs.js is rewritten on exit,
enterprise policy overriding both, and a page-level shim answering after the
browser already reported the value.

Ends by owning the trade rather than defending it. Delivering the whole fingerprint
through preferences is what makes this page necessary, and it is also what lets one
binary be any machine without being rebuilt.
2026-07-27 13:45:42 +02:00
feder-cr 219f4246a0 docs: the test-runner page said three in four places while listing four
Folding Nightwatch in left the title, the opening claim, the shared setup line and
the WebdriverIO superlative all still counting to three. Fixed, along with the two
places the index and the top-level README described the same page.

Small, but a page that miscounts its own contents is the kind of thing a reader
notices before they notice anything it says.
2026-07-27 13:42:32 +02:00
feder-cr 54c68fa3c4 docs: Nightwatch and SeleniumLibrary, folded in rather than given thin pages of their own
Both verified from source. Nightwatch reads firefox_binary and calls setBinary,
and builds FirefoxOptions from the declared capabilities, so moz:firefoxOptions
prefs carry the profile: both halves through standard WebDriver. SeleniumLibrary
reaches both too, but through two different string-format arguments, options= for
binary_location and ff_profile_dir= for a chain of set_preference calls.

Folded into the pages they belong to rather than added as separate files. Two more
short pages would have split the same audience across four documents and made the
index longer without making anything easier to find.

The SeleniumLibrary section includes the generator one-liner, because that argument
takes several hundred preferences as a semicolon-separated string of calls and
nobody is typing that. It also says plainly that Browser is the better library, and
why the section exists anyway: a suite already on SeleniumLibrary will not be
rewritten for a browser engine and should still be able to use one.
2026-07-27 13:40:05 +02:00
feder-cr 15b1ec3741 docs: ScrapeGraphAI does not fit, and the reason is not the one the shortlist assumed
Went to write the guide and read the loader instead. The passthrough is real:
browser_config is **kwargs and firefox.launch gets it, so the binary and the
preferences arrive. Then line 252, and again at 365, calls
Malenia.apply_stealth(context) unconditionally, with no flag anywhere in the file
to turn it off.

So the framework layers undetected_playwright's JavaScript patches on top of an
engine that has already answered the same questions natively. That is the exact
failure three of the explainer pages describe: two components independently
deciding who this browser is, disagreeing, and the disagreement being louder than
either being unusual alone.

Recorded in the does-not-fit list with the line numbers rather than written up as
a guide with a warning at the bottom. A page that says "here is how, but it fights
itself" would get skimmed to the code block.
2026-07-27 13:37:09 +02:00
feder-cr 41dd303f08 docs: an index for docs/, and the pages now link each other
Nineteen pages had accumulated with nothing collecting them, and eight of the ten
explainers linked nowhere at all. GitHub renders docs/README.md when you open the
folder, so that was a free landing page nobody was standing on, and pages that
link nothing are read once and left.

The index carries a short closing section on the three ideas that turn up on
almost every page, because they had been restated eight times without ever being
said once in one place: consistency beats rarity, suppressing a signal is a
signal, and server tells are not automation tells and need different fixes.

Verified every path it claims, including pinning.md, rather than listing what I
thought was there.
2026-07-27 13:29:36 +02:00
feder-cr ebc0325448 docs: how CreepJS decides you are lying, read from its source
Read src/lies/index.ts and the module layout rather than the rendered page,
because the method is the story and the number is not. Four techniques, all
quotable: a pristine reference pulled from a fresh iframe's contentWindow, which
your page-level patch never touched; stack-trace matching on /at Function.toString/
to catch a replacement hiding behind a patched toString; descriptor and prototype
walking that notices an override moved off the prototype; and the one worth the
page, that blocking its probe is itself written down, with lie names
"client blocked phantom iframe" and "client blocked behemoth iframe" in the source.

That last one is the generalisable principle and it is one this project already
holds internally: suppressing a signal is a signal. A browser that refuses to
answer is louder than one that answers plainly, because refusing is rare.

Which explains why the two obvious strategies score badly. Overriding everything
generates a lie record per surface, so effort spent hiding actively hurts. Turning
on maximum privacy protection lands you in the resistance module, which exists to
identify exactly that.

Stops short of claiming any tool is undetectable. The claim is narrower and
checkable: this category of check bites on the seam between a patch and the
runtime, and everything else stays exactly as hard as it was.
2026-07-27 13:15:41 +02:00
feder-cr 3d66b6d216 docs: what sannysoft actually checks, read off the live page
Fetched the page and enumerated its element ids rather than writing from memory,
which is how the interesting part surfaced.

Three of the canvas tests are run twice, in the page and inside an iframe, and the
results compared: canvas3-iframe, canvas4-iframe, canvas5-iframe. That is not a
fingerprint test, it is a consistency test, and it is aimed exactly at how most
anti-fingerprinting works. A script injected into the top-level document is not in
the iframe's execution context, or seeds its noise differently there, so the two
readings disagree where a real browser's never do. The same shape appears in
media1 versus media and in the battery rows.

So the honest verdict on the famous table is that it describes headless Chrome as
it behaved around 2018 and every tool fixes it on day one. Passing proves you are
not running an unmodified headless browser and nothing else. Two of the eleven rows
still carry weight and neither is about automation: the WebGL strings, which name
your hardware, and Permissions, which is the only row that cross-checks two sources
rather than reading one value.

Says plainly that a green table is worth what it sounds like, and points at the
canvas section as the part to actually read.
2026-07-27 13:01:30 +02:00
feder-cr 5248f32f83 docs: three test runners, and the one that cannot carry the profile
Checked each from source rather than assuming they were equivalent, and they are
not. Cypress builds moz:firefoxOptions with binary and prefs, so both halves are
reachable through --browser and the before:browser:launch hook. WebdriverIO takes
both directly as a W3C capability, the cleanest of the three. TestCafe has no
Firefox preference mechanism at all, searched and found nothing, so it carries the
engine and nothing else, and the page says so in bold rather than leaving it to be
discovered.

None of the three mentions this project, checked first, so all three are new.

The Cypress trap is worth the page on its own: setting userAgent in the config
makes Cypress write general.useragent.override into the same preference set the
profile uses, so it silently wins and produces a browser contradicting itself. The
line number is in firefox.ts and the fix is to leave it unset.

Ends by saying why you would use this engine in a test runner at all, which is a
realistic rendering and font stack, not evasion. A suite running against your own
staging environment does not need an identity and should not pay for one.
2026-07-27 12:44:57 +02:00
feder-cr 79640281c8 docs: Crawlee for JavaScript, and the cost of a Python dependency in a Node project
Verified from playwright-launcher.ts: launcher takes a BrowserType, its own
comment suggesting require('playwright').firefox, and launchOptions is Playwright's
LaunchOptions, so executablePath and firefoxUserPrefs both fit. They do not mention
this project anywhere, checked first, so this is a new target rather than a page
correcting itself.

Says the awkward part in the second paragraph rather than burying it: the engine
and the identity are produced by a Python package, so a Node project takes a Python
dependency, and if that is unacceptable the answer is a Chromium tool rather than a
workaround.

useFingerprints: false gets its own section because Crawlee's generator is good and
that is exactly the problem. Two independent opinions about who this browser is do
not average out, and a generated header set disagreeing with an engine-level
fingerprint is louder than either being slightly unusual alone.

Flags the trap specific to this framework: rotating proxies across countries is
normal in Crawlee, and a prefs file carries one timezone, so the browser will
contradict most exits unless the file is selected per region.
2026-07-27 12:38:42 +02:00
feder-cr d78897e63a docs: Robot Framework Browser, the cleanest fit of the set
New Browser takes executablePath and firefoxUserPrefs as documented named
arguments, verified in Browser/keywords/playwright_state.py. No subclass, no
provider, no dictionary to reverse-engineer: both halves are first-class.

Checked first whether they already say anything about this project, as the last
two integrations turned out to. They do not, so this one is genuinely new rather
than a page correcting itself.

Two Robot-specific traps are called out because the syntax invites them. New
Browser defaults to Chromium, so pointing executablePath at a Firefox build
without passing firefox first fails confusingly. And New Context offers
timezoneId, locale, viewport and colorScheme, each of which is a value that has to
agree with the profile once you set it by hand rather than being derived from it.

Includes the inline variant that reads the prefs straight from the installed
package, since a checked-in JSON file eventually drifts from the engine it was
generated for.
2026-07-27 12:06:48 +02:00
feder-cr 8d4e817f19 docs: CodeceptJS integration, which carries both halves
Verified from lib/helper/Playwright.js on 4.x: _getOptionsForBrowser returns
{ ...config[config.browser] }, spread into playwrightOptions, so a firefox block
forwards executablePath and firefoxUserPrefs together. Both halves, no subclassing.

Their own Playwright docs already mention this project as an example of pointing
at a custom executable, so this page is the wiring that mention implies rather
than a pitch.

Says what the JavaScript route gives up, same as the other non-Python pages:
humanised pointer paths, which the Python driver draws from the seed, and timezone
and locale resolved from the proxy exit at launch. And flags the CodeceptJS
specific trap, that userAgent sits right next to the options you do want, so it is
easy to override the one value that must not be overridden.
2026-07-27 12:01:19 +02:00
feder-cr 1c29b311f3 fix(tests): the taskbar fallback asserted 40, which is the value the engine never returns
Caught by the pre-push gate on a docs-only push, against core 18.3.0.

The core states the reason in place: nsScreen.cpp:114 returns {0, 0, w, h - 48},
so the sampler's fallback has to be the same number or Profile.screen.avail_height
reports a height no browser will ever produce. Its comment records that it was 40
there, and in all 93 rows of cpt_screen_given_class_tier.json, since before the
split.

So this assertion was pinning the bug. It passed for as long as the installed core
carried the same wrong number, and went red the moment the core was fixed, which
is the correct behaviour for a test that compares two sides of a contract.
2026-07-27 11:57:55 +02:00
feder-cr ca181c4a18 docs: the Scrapy guide documented the lesser of the two routes
Went to open a pull request against scrapy-playwright and found their page was
already right, and ours was behind. They have a PLAYWRIGHT_BROWSER_PROVIDER
setting and a BrowserProvider interface, shipped in the released 0.0.48, with a
worked example for this project written by their maintainer. Verified the example
against our API: async_api.InvisiblePlaywright imports, is an async context
manager, and takes profile_dir and seed as it claims.

That route hands the provider our own class, so it reaches the whole wrapper. The
settings-only route this page previously led with reaches the engine and the
preferences and nothing else: no humanised pointer paths, since those are drawn by
the driver from the seed; no timezone or locale resolved from the proxy exit, so a
proxy in another country disagrees with the browser; and no pin check.

Rewritten to lead with the provider and keep the settings route labelled as the
fallback it is. The nothing-cosmetic list is stated rather than implied, because
someone who picks the cheap route should know what they gave up.
2026-07-27 11:51:37 +02:00
feder-cr c6b189cfd9 docs: the cdc_ variable, and why renaming it is not removing it
Five of the nine results for this query are GitHub, and the non-GitHub competition
is thin, spun-looking content. A real explainer clears that bar easily.

The substance is the distinction the popular fix obscures. Patching the binary to
replace the literal defeats a check that greps for the prefix, and leaves the
surface intact: three related own properties on document, a common random-looking
stem, typed suffixes, and a replacement constrained to the same length because it
is an in-place patch of a compiled file. A detector matching the shape rather than
the string finds it again.

That generalises past this variable, which is why the page is worth writing from a
Firefox project. Any tool that runs code in the page needs somewhere to keep state,
and the three options are a known name, a random name, or not in the page at all.
Only the third removes the surface, and it is a design decision no plugin can make
retroactively.

It also says plainly that a stock Playwright Firefox is trivially detectable by a
different two-line check, since the spec requires navigator.webdriver, and that
anyone claiming Firefox is inherently undetected is selling something.
2026-07-27 11:44:26 +02:00
feder-cr e708df2946 docs: what resistFingerprinting really does, and why this project turns it off
Chosen because the query has no vendor blog anywhere in its top five: Mozilla's
own support pages, an academic paper on intervention breakage, a Hacker News
thread and a GitHub issue. An open lane, and a question this project has a
concrete answer to.

The answer is counterintuitive enough to be worth the page. Turning Firefox's own
anti-fingerprinting mode on looks like the obvious first move for an automation
tool and is usually wrong, because RFP does not make you look like a typical user,
it makes you identical to every other RFP user. That is the Tor model and it is
correct when the population is large. On the open web almost nobody has it on, so
the signature it produces is a small, sharply defined group rather than a hiding
place, and it contradicts the residential IP the session is coming from.

The distinction is the whole piece: RFP optimises for anonymity within a set, an
automated session needs plausibility as an individual, and those want opposite
implementations. The five preference values quoted are the ones this project
actually writes, all false, and a reader can print them and check.

It also says plainly when RFP is the right tool and this is not, because for a
person wanting privacy from ad networks it is, and no automation library
substitutes for it.
2026-07-27 11:41:06 +02:00
feder-cr 2ac8524024 docs: why headless browsers render different fonts
The least contested query found in this niche. Its top five results are almost
entirely primary sources, a google/fonts issue, two Chromium bug entries and two
puppeteer issues, with a single blog anywhere in the set. No content-marketing
team is competing for it, and it is a question this project has to answer
correctly anyway.

Corrects the common belief while it is at it: headless usually ships the same
fonts, what it lacks is the desktop's font configuration, so the difference is in
how a missing font resolves rather than in what is installed. Two more causes
follow from that, the rasteriser settings and the fact that web font detection
measures rather than enumerates, which is why two containers from one image can
disagree about which fonts exist.

Ends where it should: a claimed platform implies a font set, so Windows in the
user agent on the Linux default set is a contradiction nothing can override,
because nothing was overridden. Same shape as the software-rasterizer tell, and
a server tell rather than an automation one.
2026-07-27 03:11:31 +02:00
feder-cr 9a923016d4 docs(readme): put the words people actually type into the first screen
Twelve real searches in this niche showed this project absent from every top five,
including "playwright stealth firefox", which is the most literal description of
what it is. The reason was visible in the file: the first screen said "A modified
Firefox that passes every bot detection test" and contained neither "Playwright"
nor "Python", so there was nothing to match on.

The tagline now carries all of it and gives up none of the claim. Added a short
"if you got here from a search" section that names the category in the four
phrasings people actually use, and names the nearest open-source neighbours
honestly rather than pretending they do not exist, with a link to the page that
explains what each approach cannot reach, this one included.

Naming the alternatives is deliberate. A reader comparing tools is going to find
them anyway, and being the page that explains the comparison is worth more than
being the page that hides it.
2026-07-27 03:08:34 +02:00
feder-cr 5a3249cfe2 deps: follow the core to 18.3.0, after checking it is actually on the index
The core moved to 18.3.0, which is the release carrying the WebGL persona fix: the
pool no longer hands out the string Windows prints when a machine has no GPU.

Checked before pinning rather than after. invisible-core 18.3.0 is live on PyPI
with both a wheel and an sdist, so this specifier resolves. Pinning a core that
exists only in a local checkout is the one mistake this pin cannot survive, since
it makes the package uninstallable for everyone and a filename can never be
re-uploaded.

The pre-push gate is what caught the drift, on a docs-only push, which is the
argument for having it: a wrong pin is invisible to the test suite and only shows
up at install time on somebody else's machine.
2026-07-27 03:00:07 +02:00
feder-cr 0ef2eed9fe docs: WebGL renderer strings, including the software-rasterizer tell we shipped
The strongest of the queries a repository page can still win in this niche: three
of the top six results are GitHub or Mozilla primary sources, and a competing
Firefox project's own wiki holds one of them, which is direct evidence that a
technical page from a project like this one ranks here.

It explains the parts people get wrong: that Firefox on Windows reports through
ANGLE, so the vendor really is "Google Inc. (NVIDIA)" and a Mozilla-branded string
is the anomaly; that the shader-model fields correlate with the age of the card;
and that the platform you claim and the shape of this string are one comparison
rather than two values.

The middle section is our own bug, written up as the case study rather than
quietly fixed. Sampling the persona pool faithfully from real telemetry reproduced
reality's worst case, because real users do run Windows on machines with no GPU:
21 of 1,500 seeds drew the software rasterizer, and seed 42, the seed in our own
quickstart, was one of them. Now zero of 1,500. The generalisable part is that a
pool sampled from real data still needs a rule about what is disqualifying, since
"real users have this" and "you should claim this" are different questions.

Publishing the mistake is deliberate. It is the most useful paragraph on the page
and it takes the argument away from anyone who would otherwise make it for us.
2026-07-27 02:51:11 +02:00
feder-cr 7eb68f7e34 docs: link the guides from the README, since an orphan page ranks for nothing
Seven pages were added under docs/ over the last two days and nothing pointed at
any of them. A page nobody links is a page search engines reach last and readers
never reach at all, which makes the whole exercise ornamental.

Split into the two things they are: how to run the engine inside another
framework, and how the underlying mechanisms work whether or not you use this
project. The second group is deliberately written to be useful to someone who
picks a different tool, because a page that is only an advert answers nobody's
question and gets treated accordingly.
2026-07-27 02:33:05 +02:00
feder-cr 0749935746 docs: three explainers, put where the search results actually come from
A pass over twelve real searches in this niche found the split: the broad
listicle queries are held end to end by scraping-API vendors with content teams,
and the narrow debugging queries are still held by GitHub repos and issue threads.
On "navigator.webdriver undefined not working" four of the top five results are
GitHub issues and not one is a vendor blog. On "playwright detected as bot" a
GitHub issue sits second, ahead of three of them.

So these three go in the repository rather than only on a blog, because the
repository is the venue that ranks for what they answer:

- navigator-webdriver-explained: why setting it to false is worse than leaving it
  alone, since a clean browser reports undefined, and what an audit reads instead.
- playwright-stealth-levels: the three levels a tool can work at, page, driver,
  engine, and what each cannot reach. States the costs of the engine level from
  the inside, including the software-rasterizer persona found in our own pool.
- playwright-detected-as-bot: a troubleshooting order that puts "check what you
  overrode yourself" first and the proxy seventh, because the proxy is the
  expensive fix and the least likely single cause.

Each says who wrote it and what they maintain, at the end. A comparison piece that
happens to be won by its own author's project, unsigned, would be worth less than
not writing it.
2026-07-27 02:26:39 +02:00
feder-cr afd145385a docs: the engine is not Python, and every Playwright binding can already drive it
Checked each official binding's launch options: playwright-go, playwright-dotnet,
playwright-java, playwright-ruby-client and playwright-rust all expose
executablePath and firefoxUserPrefs, because they mirror the same API. Those are
exactly the two halves this project needs, so the patched Firefox runs from Go,
Java, C#, Ruby and Rust today. The package is how you obtain and configure the
engine, not a requirement for driving it.

The page says what you give up outside Python, because it is not nothing: automatic
timezone and locale resolution from the proxy exit, humanised pointer paths, and
the pin check that refuses a binary which does not match the config that produced
the prefs. Upgrade the binary, keep an old prefs.json, and nothing warns you.

It also records a real gap rather than working around it quietly: the CLI can print
the binary path but has no command to emit the preferences, so the guide tells you
to generate them with a one-liner. A `prefs --json` subcommand would make this
route clean.
2026-07-27 02:23:24 +02:00
feder-cr da5af3a289 fix(hooks): track the pre-push hook as executable so POSIX git will run it
The previous commit added the test; this is the mode change it asserts. Git
refuses to run a hook without the executable bit, prints that it "was ignored
because it's not set as executable" and exits 0, so on every POSIX clone the push
went out with none of the gates behind it having run: not the suite, not the
core-pin check, not the forbidden-name scan.

It survived because this is developed on Windows, where core.fileMode is false.
The mode lives in the index, which is why chmod-ing the working tree never fixed
it.
2026-07-27 02:06:08 +02:00
feder-cr c164a91b4b docs: Scrapy integration, and an index that says which half each framework can carry
scrapy-playwright is the cleanest of the three so far and the only one that takes
the whole thing with settings alone. Verified from provider.py: it splats
PLAYWRIGHT_LAUNCH_OPTIONS straight into browser_type.launch, so the dict carries
executable_path and firefox_user_prefs together. Their own docs already name this
project as one of several compatible backends, so the wiring is the part that
belongs on our side.

The index exists to make the distinction impossible to miss. A framework that
forwards arbitrary launch options carries both the engine and the seeded profile.
One that only exposes a browser-path setting carries the engine alone, which means
every user of that build shares one identity. Each page now states which case it is.

It also lists, by name, the frameworks this does not fit and why: Chromium-only
launch paths, remote-CDP-only connections, and the ones that build launch arguments
as a fixed dict with no passthrough.

Not pushed. Public repo, needs an explicit go.
2026-07-27 02:06:08 +02:00
feder-cr 468343cd2b docs: the MCP channel was never blocked, and a one-liner is not the integration
Yesterday's note said MCP was unreachable because we do not ship an MCP server.
We do not, and it turns out not to matter: Microsoft's own playwright-mcp takes
--browser firefox and --executable-path, so it drives this engine today with two
settings and no code. Guide added.

Both guides now make the same distinction, because it is the one people will get
wrong. Passing only the binary gets the patched engine and not the seeded profile:
the identity lives in firefox_user_prefs, which neither --executable-path nor
Crawlee's default_browser_path can carry. That yields one identity shared by every
user of a build, which is its own signal. The crawlee page now shows the one-liner
and says plainly what it costs, next to the plugin that does it properly.

Verified against current sources: crawlee's default_browser_path field and its two
env aliases, and playwright-mcp's two flags with their env equivalents.

Not pushed. Public repo, needs an explicit go.
2026-07-27 02:06:07 +02:00
feder-cr 58e8321bcb fix: the pre-push hook was tracked 100644, so git never ran it on POSIX
git refuses to run a non-executable hook: it prints an advice line and exits 0,
so the push succeeds with none of the gates behind it having run. All three
repos were 644. It survived because core.fileMode is false on Windows, where
this is developed - the only machine that ever ran the hook was the one machine
that could.

The mode belongs to the index, so chmod-ing the working tree never changed it
and a fresh clone inherited the same broken mode.

The test asks git rather than the filesystem, because os.access(X_OK) is
meaningless on Windows and returned True the whole time.
2026-07-27 02:06:07 +02:00
feder-cr 623a542951 fix(tests): two tests that only passed on the machine they were written on
CI has been red on both since they were written, for the same underlying
reason: they asked the developer's checkout a question that only the installed
package can answer.

_REQUIRED_PREFS_KEYS listed media.webm.enabled and media.mp4.enabled. Those two
prefs were renamed to their real Firefox spellings in the CORE's checkout, and
the pinned core release does not emit them yet. But invisible_playwright.prefs
is a pure alias shim for invisible_core.prefs, so this file tests the core's
function through an alias - against whichever core pip resolved, which locally
is the checkout and on CI is the published wheel. The list was asserting a
contract the declared dependency does not meet, which is a NORMAL state between
releases. A gate that is red for a normal state is a gate people learn to
ignore. The two keys are asserted in the core's own suite, where the change
lives and where the assertion moves with it.

In exchange the proxy test got stronger: it now compares against the dict as it
was before the call rather than against the literal list, so it catches the loss
of ANY key, including ones nobody thought to list, and says the same thing
whichever core is installed.

test_readme_claims looked for two env vars in `_REPO.parent / "invisible_core"`
- a SIBLING CHECKOUT, which exists on the workbench and nowhere else. On CI only
this repo is checked out and the core arrives as a wheel, so the path was
missing, the comprehension yielded nothing, and the test reported that the
README documents a variable no module reads. It was reading the developer's
directory layout. It asks the installed package now, which is what a user's
environment actually contains either way.
2026-07-27 01:26:29 +02:00
feder-crandClaude Opus 5 cee33ba695 docs: integration guide for Crawlee, hosted here because that is where they asked
Crawlee declined a stealth-browser example in their own docs in June, and issue
1936 says why and what to do instead: they will not feature fresh third-party
tools, and third-party projects should host their own integration guides on their
side so Crawlee can link to selected ones. We never wrote ours. This is it.

Written against their current master rather than against the merged examples. That
mattered: the examples merged in March pass header_generator to
PlaywrightBrowserController and the current API takes fingerprint_generator, so
copying the accepted pattern would have shipped a guide that does not run. The
subclass also respects use_incognito_pages and the persistent-browser path instead
of ignoring them.

Verified: the snippet parses, every imported name is exported from crawlee.browsers,
and PlaywrightPersistentBrowser comes from the public package rather than the
private module.

Not pushed. Public repo, needs an explicit go.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 01:03:16 +02:00
feder-cr 3b49449efa docs(pinning): the page documented a knob that raises
`fonts` was listed as a top-level pin key - "complete font allowlist, the
sampler usually picks 14-24 system fonts". Passing it raises ValueError. It
stopped being an axis when the engine moved to a bundled font list: the exposed
set is the same families on every install and every OS by construction, and
varying it per profile would put back the entropy the bundle exists to remove.
The row outlived the feature by several releases because nothing read the page.

The right pin for fonts is no pin, and the page says so now rather than just
dropping the row - a reader who remembers the key needs to be told where it
went, not left to infer it from a ValueError.

browsing_history was the opposite case: a real profile field, documented
nowhere, and not pinnable either. Fixing the seed already fixes it. Said out
loud so nobody tries.

tests/test_pinning_doc.py, six cases, none of which read prose:

  every documented key is handed to the real validator through
  generate_profile, not compared against a copy of the key table - the thing in
  doubt is what a reader's call does;
  every pinnable key must appear on the page, which is the direction that
  catches the NEXT one rather than this one;
  the validator's hand-written _PIN_GROUPS must match the profile dataclasses
  it describes, or a new field is unpinnable with no error anywhere;
  the page's worked examples are parsed and their pin dicts checked, because
  examples and key tables drift apart independently and examples are what
  people copy.

Mutation-tested: putting the fonts row back, deleting a valid key from the
page, breaking a key in an example, and adding a field to the validator that
the model does not have are all red. 743 pass.
2026-07-27 01:00:09 +02:00
feder-cr da3bf64615 chore(hooks): scan the commit messages too, not just the files
The name scan only ever read what the wheel and the sdist carry. That is the
PyPI surface; this repo is public, so its workflows, its hooks, its docs and its
commit messages are published just as surely as its source. Commit messages had
never been read by anything, and that is where names went out.

The hook now reads the refs git feeds it on stdin and hands the range to the
scanner, so the messages about to be pushed are scanned while they can still be
reworded - after the push a message cannot be changed without rewriting history.
A branch the remote has never seen becomes "<sha> --not --remotes"; a deletion
pushes no content and is skipped.

It also runs the scanner's own known-bad cases first. A gate nothing tests is
not a gate, and this one had been returning a clean verdict over three of the
four surfaces it was believed to cover.
2026-07-27 00:45:40 +02:00
feder-cr 1d990408c3 docs: four of the five CLI lines in the README were command not found
They used `invisible_playwright` with an underscore. The installed console
script is `invisible-playwright` with a hyphen. The Install section two hundred
lines above is correct (`python -m invisible_playwright ...`), which is how this
survived: anybody testing the quickstart never reached the CLI block.

Also corrected, all of them things a reader checks before starting:

  the download is ~238 MB and ~544 MB unpacked, not the ~100 MB stated - a 2.4x
    understatement on the number a user weighs against their disk and their
    patience;
  `doctor` existed and appeared nowhere on the page. It is the command whose
    output a bug report needs, so leaving it undocumented cost twice;
  `path` downloads the engine if it is absent. The line described it as merely
    printing a path, so a cold `path` fetched 238 MB unannounced;
  the cache location was documented nowhere, in any of the three READMEs, and
    neither were the environment variables. There is a table now:
    INVISIBLE_PLAYWRIGHT_CACHE_DIR, INVPW_BINARY_PATH, STEALTHFOX_GITHUB_TOKEN,
    INVISIBLE_PLAYWRIGHT_SKEW, INVPW_CURSOR_ENGINE.

Eight tests keep it that way, and none of them reads prose: a bare invocation
must use the installed name, every documented subcommand must exist, every
subcommand must be documented, every documented env var must be read by a
shipped module, and every size on the page must sit inside what the seal
supports.

That last one had to be inverted after mutation testing. It first accepted the
set if ANY figure was close, so putting one of the two occurrences back to
~100 MB left it green - a check that tolerates a wrong number as long as a
right one is nearby.
2026-07-27 00:14:51 +02:00
feder-cr a9a13bf5e6 ci: two false greens, one of them demonstrated by its own only run
WEBRTC-E2E WAS GREEN WITH ITS HEADLINE ASSERTION SKIPPED. Run #1 logged
"1 passed, 1 skipped", and the skipped one is the test this workflow's header
calls the point of the gate. Two things allowed it:

  the binary path was assigned as `echo "VAR=$(cmd)" >> $GITHUB_ENV`. echo
    exits 0 whatever the substitution did, so `set -e` never sees a failure and
    an EMPTY value lands in the environment - after which both tests skip on
    "no patched binary", pytest exits 0, and the job is green having verified
    nothing. It now captures, checks the path exists, and refuses;
  it was the only one of four workflows with no floor. It now refuses on ANY
    skip, not merely on a low count, and prints the SKIPPED lines - because
    here a skip is the failure mode, not an edge case.

TESTS.YML HAD NO FLOOR EITHER, on the largest suite of the three. `addopts`
already filters two markers; one more, or a typo in one, turns 726 tests into 0
and reports success. Floor at 600.

Both gates were driven against known-bad reports using the gate's own code
lifted out of the workflow rather than a re-implementation - including, for
webrtc, the exact "1 passed, 1 skipped" text run #1 produced. It refuses it.
2026-07-26 23:47:13 +02:00
feder-cr 6cb631beca fix: seven tests pinned pref names the engine never reads
The core stopped emitting four dead prefs and this repo went red - which is the
useful part. These tests listed `zoom.stealth.screen.avail_width/height`,
`zoom.stealth.screen.dpr` and `zoom.stealth.webgl.msaa` among the REQUIRED keys
of a valid pref set, so they were guaranteeing the presence of names that appear
nowhere in the engine source. A required-key list that requires no-ops gives
confidence in nothing and makes removing dead code look like a regression.

Pointed at what actually controls the behaviour:

  the MSAA tests now read `webgl.msaa-samples`, an upstream Firefox pref we set
    and the engine honours. Only our `zoom.stealth.webgl.msaa` was dead, so the
    behaviour these tests describe still exists - they were watching the wrong
    name for it;
  the codec keys move to `media.webm.enabled` / `media.mp4.enabled`;
  device pixel ratio moves to `layout.css.devPixelsPerPx`, which is where it
    actually reaches a page;
  the two avail_* keys are dropped - nsScreen derives the available rect from
    screen.width/height and never reads them.
2026-07-26 23:42:23 +02:00
feder-cr dcdbf200ff fix: the process-leak fix shipped to half the users and said it was fixed
0.4.0 tied the browser tree to the process lifetime and the release notes said
so. It reached the sync launcher only. async_api.py did not import _reaper at
all: no token, no guard, no stamp, no reap. So every async user on Windows kept
the entire leak - a killed runner leaving eight to twelve browsers behind - for
three releases, while the changelog told them it was closed.

Nothing was red, and could not have been. This module is at 29% coverage, no
test enters its context manager, and the async test file asserted parity in its
DOCSTRING while exercising the constructor.

Now identical to the sync path: mint the token, stamp it into the browser env,
bind the tree to a job object after launch, reap unconditionally at the end of
teardown - which matters because every close step above it is individually
wrapped in `except: pass`, so a browser that refuses to close is otherwise
swallowed in silence.

Three tests, each checked against its own mutation:

  the stamp, asserted on the env the browser would actually receive, since
    that is the only thing the guard can key on;
  structural parity of the machinery on BOTH classes - deliberately about
    names, because what failed here was one module never growing the
    attributes, and a test comparing outputs would have passed on two objects
    that share nothing;
  teardown reaps, driven through the real _teardown with a recording guard.

Removing the stamp, the reap, or the guard declaration each turns exactly one
of them red.
2026-07-26 22:50:47 +02:00
feder-cr 4c2d17a475 fix: the user-path e2e could not even be COLLECTED where it is meant to run
The workflow installs only pytest on the runner, deliberately: the package
under test goes into a venv the fixtures build from the index, and a second
copy on the runner's path would mean every assertion reads the wrong one.

Two module-level imports contradicted that and killed collection outright -
exit 4, "No module named invisible_playwright", on both runners, while passing
locally where a checkout is always importable. The workflow had never been
executed before today, so nothing had ever put the two decisions in the same
room.

  tests/test_release_e2e.py imported FIREFOX_UPSTREAM_VERSION to build its
    assertions. It now reads that from the VENV, which is the more honest
    question anyway: what a user gets is what the INSTALLED package reports,
    not what this checkout says;
  tests/conftest.py imported _fpforge and constants at module level, so the
    guard above was not enough on its own. The import is now guarded and the
    fixtures that need it fail at USE time with a message naming the one
    situation where this is expected - a clear failure about one test instead
    of a collection error covering the whole run.

Verified in the condition that broke it rather than reasoned about: 11 tests
collect under a Python with the package absent, 7 e2e pass locally, and the
default suite is unchanged at 726.
2026-07-26 19:01:53 +02:00
feder-cr ffbb94adb0 fix: the fingerprint pinned float64, which no platform can agree on
Three of four CI runners red, passing locally. Measured rather than guessed, by
running the identical 576-case grid on Windows and on Linux:

  on the SAME Python, ONE case out of 576 differs, with the same waypoint
    count - a last-bit libm difference in one coordinate, at one input;
  hashing the INTEGER PIXELS instead, the two platforms are byte-identical.

That settles what the promise can honestly be. A pointer event carries integer
coordinates, so the sub-bit disagreement is not observable by a page, a
detector or a user: it exists only in a float nobody dispatches. The test was
pinning an implementation detail of libm, and a gate that cannot be green on a
supported platform is a gate somebody eventually deletes.

So it pins what reaches the wire - the rounded pixel, the millisecond, and the
number of events - and the count digest is asserted FIRST and separately.
Counts are integer-valued, so a changed count means the rng is being consumed
differently, which is a categorically different mistake from a coordinate
moving and deserves its own message.

Still catches what it was built for: both float-associativity regressions it
found during the planner extraction moved rounded pixels, not merely last bits.
A fourth test asserts the hashed coordinates really are integers, so an edit
that "tightens" this back to raw floats trips over the reason it must not.

Verified on both platforms rather than reasoned about: 4 passed on Windows and
4 passed on Linux, same file, same fingerprints.
2026-07-26 18:50:09 +02:00
feder-cr 8c5ae81873 test: the launch test skipped Windows for a reason that is not true
The skip said "headless launch path requires display server". On Windows it
does not, and never did: headless=True there keeps the real rendering pipeline
and hides the window through the binary's own cloak. Linux is the platform that
needs a display, and it gets Xvfb.

So the full-stack test - wrapper init, Firefox launch, Juggler handshake,
page.goto, page.evaluate - had never run on the primary target, behind a stated
reason that was false. The two most recent defects in this package were
Windows-only by construction, since firefox.exe is a launcher stub that spawns
the real browser and exits; neither was reachable from here.

Removed, and verified rather than assumed: 7 e2e tests pass on Windows,
including that one.

The module docstring described three tests by their old names and behaviour,
including the git install and the linux-only launch. Rewritten to describe what
the file does now, with both mistakes kept in it - a docstring that quietly
becomes fiction is how the git-install path survived a rename.
2026-07-26 18:25:16 +02:00
feder-cr 83e43cb7bd test: nothing covered the path every EXISTING user takes
The install tests all start from an empty venv, which is a route each user
takes exactly once. `pip install -U` is the one they take repeatedly, and it
was untested.

It matters more here than in most packages because of the shape of the
coupling. The wrapper declares an exact `invisible-core==X.Y.Z`, so an upgrade
has to move two distributions in step, and a half-moved environment is repaired
IN PROCESS at import rather than raising - which means a repair that silently
does the wrong thing is indistinguishable from one that worked. From outside,
the import just returns.

Four tests, driven against the live index:

  upgrading from the PREVIOUS published release moves the core with the
    wrapper, and pip agrees afterwards. The previous version is read from the
    index rather than written down, so this does not go stale on the next
    release;
  the upgraded environment holds exactly ONE core root in sys.modules, imported
    from site-packages and not from a checkout that happened to be on the path,
    and the version its metadata reports is the one the module derives from its
    own seal. A swap performed under objects the caller holds leaves two alive
    and shows up much later as behaviour that matches no reported version;
  a hand-pinned old core makes `pip check` exit 1. That is the whole reason the
    dependency is a real specifier: a direct URL has no version to compare, and
    pip reports a broken environment as clean;
  importing the wrapper repairs that environment in the SAME process. Asserted
    on the version afterwards, never on the absence of an exception - "no
    exception" is also what a repair that did nothing looks like.

One assertion in the first draft was `assert reported in path or True`, which
asserts nothing at all. It is now the check it was meant to be: the core has to
come from site-packages, or a venv test could be silently reading the
developer's working tree and passing everywhere.

CI runs both e2e files and the "did anything actually run" floor moves from 3
to 6, re-validated against a report where one of the two files skips itself
entirely - which is the failure a fixed threshold of 3 would have waved through.
2026-07-26 18:13:13 +02:00
feder-cr d0903dec60 test: the user-path e2e was testing a route no user takes
It installed from a git URL. That stopped being anybody's install path on
2026-07-26, when the three packages went to the index, and the difference is
not cosmetic: a git install never resolves `invisible-core==X.Y.Z`, so the
entire pin mechanism - the part most likely to break a release, and the reason
a binary bump is now a three-package release - was outside what this file
could see.

It also installed a blessed `playwright==<pin>` immediately afterwards, and
that line was hiding exactly what the test exists to find. If the declared
range resolves to a client the shipped Juggler cannot speak, installing the
pin afterwards REPAIRS the venv and the suite goes green while every fresh
install is broken. What a user gets is what pip resolves from the declaration,
so that is what is asserted now - including a test that the resolved
Playwright is inside the range the package itself declares, which is a
question neither side can answer alone.

`INVPW_E2E_SOURCE=git` still reaches the old route for verifying an
unpublished commit. It is a pre-release check now, not the default, and the
test says so where somebody reading a failure will see it.

CI: .github/workflows/user-install.yml runs this on ubuntu-24.04 AND
windows-latest, daily and on release. Windows is not decoration - the two most
recent defects were Windows-only by construction, since firefox.exe is a
launcher stub that spawns the real browser and exits, and the job-object fix
for it has no counterpart on Linux.

The workflow refuses a run in which fewer than three tests actually ran.
pytest's exit code cannot distinguish "all passed" from "all skipped", and
every test in this file is gated on a marker and some on a platform, so
skipping itself into a green tick is its most likely failure. That refusal was
driven against four known-bad reports - missing, all-skipped, under-threshold
and empty - using the gate's own code extracted from the workflow rather than
a copy of it.

Deliberately NOT made tolerant. There is a real window, between publishing the
core and publishing the consumers, in which this cannot pass; `|| true`,
`--no-deps` or a git fallback would each produce a green job that installed
nothing, and that lie outlives the window by months.
2026-07-26 18:03:52 +02:00
feder-cr 20e4ca010e test: the snapshot that the whole in-process repair rests on had no killing test
Replacing the three-line `any(name == "invisible_core" or ...)` in _pin.py with
a hardcoded False left this package's entire suite green. The two tests that
touched the value could not see it: one is a source-order scan, and a hardcoded
line still sits before the import; the other asserts
`seen["core_preimported"] is _pin._CORE_PREIMPORTED`, a tautology whatever the
value came from.

It matters because _CORE_PREIMPORTED is the entire soundness argument for
repairing the core in-process. repair_core refuses to swap it when the value is
true and the core-side guard is real - but THIS package computes the input.
Degraded to a constant, `import invisible_core; import invisible_playwright`
with a mismatched pin drops invisible_core.* out of sys.modules and re-imports
it underneath objects the caller already holds: two versions alive in one
process, every test still passing.

The twin already existed next door in the manager and killed the same mutation
there. Ported: a stub core echoes back what it was handed, imported once in a
child that has not touched invisible_core (must be False) and once in a child
that has (must be True). No constant satisfies both.

The stub's contents are derived from this package's real import list with ast,
because a stub that lags behind it kills the child on ImportError - and an
ImportError in a subprocess reads exactly like the assertion failing.
2026-07-26 17:52:02 +02:00
feder-cr 1060ac9f18 chore: 0.4.2 - the refactor reaches the index
0.4.1 shipped the lifetime guard's rewrite; this carries the planner and idle
and approach split, so what is on PyPI is what is in the repo. No behaviour
change: the paths are byte-identical and a fingerprint test now says so.
2026-07-26 17:08:23 +02:00
feder-cr e7711323ac refactor: three long functions become named stages, with the paths pinned
The planner was 203 lines in one function, the idle planner 134 with its
episode weights written as bare cumulative literals in an if/elif chain, and
the approach 103 mixing guard clauses, target selection and a time budget.

  _plan          -> six stages: control polygon, duration, sample times,
                    overshoot, curve sampling, tremor, duplicate collapse
  plan_idle      -> a table of episodes; the weights are data and the ordering
                    is asserted rather than assumed
  _approach      -> _choose_landing (one small scope owning the element
                    handle) and _walk_onto (spends the time budget)

Byte-identical output, which is the whole point and was not free. Extracting
looked completely safe and changed the result twice, both times through float
multiplication not being associative:

  axis.at(dist * u, ...) computes ux * (dist * u) where the original wrote
    ux * dist * u, i.e. (ux * dist) * u;
  returning amp * w from the overshoot and multiplying by the unit vector at
    the call site regrouped the same product the same way.

Neither was visible in any statistical test - they check distributions, and a
last-bit shift leaves every distribution intact - and both changed a rounded
pixel and therefore every draw downstream of it. tests/test_motion_fingerprint
now pins 576 cases and 16135 waypoints, with a second test that perturbs a
style field by one part in ten thousand and requires the fingerprint to move,
so it cannot quietly become decoration.

CHANGELOG catches up with 0.4.0 and 0.4.1. 723 tests green.
2026-07-26 17:07:10 +02:00
feder-cr 9bf507bdbf chore: the name scan no longer blocks a clone that has no word list
The first cut refused whenever the scanner was not at the workbench path, so
every clone of this repo was stopped on every push with no way to comply - the
word list deliberately lives outside it. A gate that is red by default is one
people switch off, and switching this one off disarms the rest of this hook.

Configured-but-missing still refuses, since setting the variable is somebody
saying to run it. Absent is now one printed line and a normal push, never
silence: silence reads exactly like a scan that ran and passed.
2026-07-26 16:23:02 +02:00
feder-cr 7f152229bd refactor: the lifetime guard is a strategy, not a module of flags
0.4.0 shipped the behaviour and the behaviour is right, but the module was one
file doing four jobs: minting identity, searching with psutil, killing, and
fifty lines of inline Win32 ctypes - held together by a module-level handle and
os.name tested wherever it happened to be needed. It worked and it would have
rotted.

Three pieces, one job each:

  SessionToken    a value object. Mints itself, stamps an environment, answers
                  whether a process is ours. Equality by value, and an EMPTY
                  token is falsy and matches nothing - which is what stops a
                  session that failed before minting one from sweeping the box.
  find_processes  the search, and now the only place psutil appears.
  LifetimeGuard   the strategy: JobObjectGuard on Windows, NullGuard elsewhere.

os.name is tested in exactly ONE place, guard_for(), so no launcher code
branches on the platform - it takes a LifetimeGuard and never asks which one.
NullGuard is a Null Object in the strict sense: it satisfies the interface and
REPORTS that it guarantees nothing (guaranteed is False, bind returns 0) rather
than doing nothing while looking like it worked. It still reaps, because
immediate cleanup is the part that needs no kernel.

Six mutations, each turning a test red, and two of them exposed tests that
proved nothing until this pass:

  the empty-token guard inside matches() was covered for by the duplicate guard
    in find_processes, so removing either left the suite green. There is now a
    test that calls the matcher directly;
  stamp() copying its input was untested. Mutating it to mutate in place does
    not merely fail - it poisons os.environ, every subprocess inherits the
    token, and the reaper kills the test runner. Caught by isolating the case.

Behaviour is unchanged and re-verified: the kill test still passes, and
flipping KILL_ON_JOB_CLOSE to zero still turns it red. 721 tests green.
2026-07-26 15:32:18 +02:00
feder-cr 76201aa744 chore: 0.4.0 - the cursor is drawn here, and the browser tree dies with us
A minor rather than a patch: pointer movement is generated in this package now
instead of in the engine, and psutil joins the dependencies. The core pin moves
to 18.2.0 with it, so a cold install resolves the geo budget alongside.

Also drops a comment that had gone stale under its own subject: the sdist
exclusion list still explained why the forbidden-name guard was excluded, and
that guard is no longer in this repository at all.
2026-07-26 14:38:09 +02:00
feder-cr 6b15f275e8 fix: the browser tree now dies with this process, even when it is killed
Twelve runs of one test left eleven browsers alive. The first diagnosis blamed
"any path where teardown does not run cleanly - a timeout, an exception out of
the with block, a killed runner". Those are not the same thing, and only one of
them leaks.

The exception path does NOT leak. Interleaved A/B over four launches on a real
browser, arms differing only in whether the new cleanup ran: zero survivors in
both. __exit__ executes and Playwright tears the browser down correctly. The
first version of this fix was a careful solution to a path that was not broken,
and it only came out because the measurement was run before the fix was
believed rather than after.

The killed-runner path leaks badly, and the bug report said so in a detail that
was read past: three of the twelve runs had TIMED OUT. Reproduced directly -
launch, kill the runner, count what is left: eight survivors, then twelve.
There __exit__ never runs at all, so nothing written inside _teardown can help
however well written.

So the guarantee comes from the kernel. The tree is bound to a Windows job
object with KILL_ON_JOB_CLOSE; this process holds the only handle, and when it
ends - cleanly, by exception, or killed outright - the kernel empties the job.
Processes created inside a job join it automatically, so content processes
spawned later are covered without being tracked. Same probe after: 0 and 0.

Identification is exact, not heuristic. Each session mints a random token and
stamps it into the browser's environment; children inherit it, so every process
in the tree carries it, and only processes positively carrying it are touched.
The alternative - "a firefox that appeared after we started" - eventually kills
a healthy browser belonging to a session running beside it, and a leaked
browser is recoverable where that is not. A process whose environment cannot be
read is left alone.

Windows only, which is where the bug is: on Linux the launched process IS the
browser and Playwright keeps hold of it, while firefox.exe is a stub that
spawns the real browser and exits, re-parenting the tree out of reach. psutil
becomes a hard dependency rather than an optional one, deliberately - an
optional reaper is absent exactly on the machines that need it, and silently.

Ten tests, each validated against a known-bad input: flipping KILL_ON_JOB_CLOSE
to zero turns the kill test red, and failing OPEN on an unreadable process
turns five red. One was vacuous as first written - "an empty token matches
nothing" passed with the guard removed, because a process without the variable
answers None and None is not "". It is now written around a process whose token
IS the empty string, the only input that separates the two.
2026-07-26 14:13:03 +02:00
feder-cr 275d3df7f1 chore: the forbidden-name scan moves to the workbench gate
It was a test in invisible_playwright that failed closed without the word
list. Correct behaviour, wrong home: the list is deliberately not carried in
any public repo, so a fresh clone got red tests it could never make green, and
a suite that is red by default gets pushed past with --no-verify - which turns
off every other gate in this hook at the same time.

The scan now runs from the workbench, resolved the same way as the core-pin
gate, and a gate that cannot be reached refuses instead of passing quietly. It
runs on every push rather than only on release tags: a name is public the
moment the branch lands, and a force-push does not take it back.
2026-07-26 13:56:30 +02:00
feder-cr 640f931aab feat: draw the cursor here, from the session seed, instead of in the engine
The engine's generator builds every stroke from constants: a fixed knot-box
padding, exactly two knots, one quadratic easing, one step-count law, one jitter
probability. Constants are shared by every install, so the shape they produce is
the same for every movement of every session of every user - and a shape that
never varies is an identity, not a detail. Measured over 1.94M points before any
work started:

  the Y residual mean is +0.4976 px and EVERY path is biased (per-path minimum
    +0.000 over 4000 paths), so one movement is enough to see it;
  the X residual's distinct-value set is literally {0.0} - no noise at all, so
    every waypoint lies exactly on an analytic cubic and FOUR events solve the
    control polygon in closed form. The Y jitter cannot hide a curve whose X is
    exact;
  the velocity profile has sd <= 0.0057 and peaks at the FIRST step in the
    median case, i.e. infinite initial acceleration and decay. A hand's profile
    is bell-shaped and peaks near the middle;
  a move under 50 px detours 3.87x the straight-line distance, a 2 px move
    dispatches 24 events, and every movement ends with at least 3 events at one
    coordinate.

This needs no new binary, which was verified in the source before starting: the
humanize hook dispatches waypoints with jugglerSendMouseEvent passing
pressure, inputSource 1 and the synthesis flags, and the ordinary sendEvents()
path that serves a plain page.mouse.move() passes byte-identical arguments. A
move driven from Python is indistinguishable from one the engine generates.

WHAT THIS ADDS
  _motion.py    draws one stroke, every shape parameter from the session seed
  _behaviour.py plans WHEN and WHERE movement happens - drift while reading,
                motion while the wheel turns, overshoot and correction, and
                movements that end on nothing (if every endpoint is a control,
                the endpoint set is a signature however good each path is)
  _cursor.py    wraps the six funnels every pointer action already goes through,
                so page.click written a year ago gets this with no edit. A
                weak-keyed registry leaves a plain sync_playwright() browser in
                the same process untouched, and aiming is a hint that is fully
                swallowed: it can neither delay a call that would have passed
                nor invent an exception on one that would have failed.

MEASURED AFTER
  jitter mean +0.00039 px, CI contains zero, 0.499 of paths positive
  both axes carry noise; a cubic through 4 neighbours misses the 5th by 0.239 px
  tremor is two-dimensional (sd ratio 0.601, was rank-1 with corr 1.000)
  speed peaks mid-stroke; backtracking 2.75% of steps on 32% of paths
  per-seed shape divergence 1.79x at 600 px, was 1.05x
  Fitts uses the real target width: 908 ms to a 20 px control, 423 ms to a 220 px

ONE STROKE MODEL, ENFORCED. _behaviour carried its own as a fallback, so two
intra-move laws could ship and a detector would see a different one depending on
which call site ran. Deleted, and the renderer is a required argument in all
five planners: forgetting it is a TypeError, not a silent second law.

ONE PHYSICAL FLOOR. MIN_EVENT_INTERVAL_MS was an independent 4.0 here while the
generator reasoned from 125 Hz / 8 ms. Two numbers for one physical fact, and
the looser one won wherever it was applied last - the generator emitted 3.52 ms
gaps (284 Hz) and _fit_timeline produced 1.83 ms (547 Hz). One constant now.

NOT BETTER, and recorded rather than buried: duplicate positions run 7-10%
through the macro path against the engine's 8.07%, i.e. parity. Raising the
merge threshold was tried as the lever and reverted - it moved the rate from
0.098 to 0.095. The cause is the small reading movements themselves.

Seed determinism is intact: same seed, byte-identical fingerprint hash.
709 tests green.
2026-07-26 13:43:46 +02:00
feder-cr 251a94853a ci: ask the package where the binary is, instead of rebuilding the path
Every Windows cell of firefox-launch-matrix has been failing since the seal
landed, and failing in the worst possible way: the verify step assembled the
cache path by hand as `Cache/firefox-7/firefox.exe`, while the cache has been
content-keyed as `Cache/<tag>_<version>_<buildid>/` since then. So the step
reported NOT FOUND - which is indistinguishable from the launch failure the job
exists to detect. Nine red cells read as "the bug reproduces on every Windows
edition". It does not; the binary was simply not where the script looked.

The path now comes from `python -m invisible_playwright path`. That is the only
thing that knows it, and a string assembled anywhere else is a second copy of a
naming rule that has already moved once.

Two other things the same drift had hidden. The step named "Fetch firefox-7
binary" runs `fetch` with no argument, so it has been fetching the SEALED tag
for a while - the name was the only part still saying 7. And the job cannot do
what it was written for at all any more: a sealed core serves its own tag and
refuses every other, so `fetch firefox-7` is a SealMismatch by design. Driving
an old tag needs the core that was sealed to it. The header says so now rather
than implying an investigation that can no longer run.
2026-07-26 02:11:25 +02:00
feder-cr 4f8f546d44 chore: declare the distribution as invisible_playwright, pin core 18.1.0
The declared name now matches the import name. Nothing functional: pip and
importlib.metadata normalise the two spellings to the same project, and
`pip install invisible_playwright` already worked.

The rename found a real defect while landing. test_pyproject_declares_the_pin_
exactly_once still carried its own regex, `r'"invisible-core==[^"]+"'` - the
seventh copy of the requirement parsing the consolidation was meant to remove,
and the one the file's own header warns about ("a test that parses the pin its
own way tests its own regex"). It survived because nothing had ever handed it a
spelling it did not anticipate. Writing the pin as invisible_core did, and the
test read zero of a pin that was present and correct. It counts through the
shared parser now, so every legal spelling passes and a missing pin still fails.

0.3.5 -> 0.3.6; the core pin follows to 18.1.0.
2026-07-26 00:08:50 +02:00
feder-cr be34c3def6 feat: install from the index, with the core pinned exactly
The core dependency was a bare `invisible-core @ git+https://...` with no ref.
Measured, not assumed: that shape pins nothing (it resolves to whatever the
default branch held at install time, forever), and it is invisible to `pip
check`, which has no version specifier to compare and answers "No broken
requirements found" on an environment running the wrong core. The same mismatch
written as a real specifier is caught, exit 1. An index also rejects a direct
reference outright, so the package could not have been uploaded as it stood.

It is now `invisible-core==18.0.0`, declared once, in pyproject.toml. The
import-time assertion reads it back out of this package's own metadata rather
than carrying a second copy, and a test fails if a copy appears. What the
resolver cannot see is the --no-deps and lockfile residue, and that assertion is
the only layer that does - so a mismatch there is now repaired in process rather
than reported, with the repair, its guards and its timeout living in the core
where the profile manager shares them.

The comparison itself moved to invisible_core._pin. What stays here is the
prelude: the few lines that still run when the core cannot be imported at all,
which is the one state a module inside the core can never report on. It tells
"core missing or too old" apart from "core present, its own dependency missing",
because those have different cures.

Packaging, all of it measured on the built artifacts rather than inferred:
- the sdist carried tests/playwright-upstream, 322 files of Apache-2.0
  third-party source inside a distribution declaring MIT. Excluded, and the
  directory is now gitignored so `git add -A` cannot commit it either. 1.27 MB
  to 282 KB.
- README images and links were repo-relative; an index does not rewrite those,
  so the project page would have rendered with broken images and 404 links.
  Badges point at main because a badge is a status indicator; screenshots and
  the banner are pinned to a commit because those are evidence of a state.
- the Firefox badge said 150.0.1 while the seal ships 151.0.

Install instructions changed. Prose did not.
2026-07-25 23:48:05 +02:00
feder-cr 7a8693c6b4 deps: restore the Playwright floor to 1.55, bump 0.3.5
Revert the 0.3.4 drop to 1.40. Keep the conservative CI-tested floor (1.55) with
the tested upper cap (1.61.0): >=1.55,<=1.61.0.
2026-07-24 18:43:35 +02:00
feder-cr 44afe950b3 deps: lower the Playwright floor to 1.40, bump 0.3.4
The >=1.55 floor was never a real compatibility bound - it was just the single
minor pinned when 0.3.1 tightened the range. The firefox-18 binary was smoke
tested (launch, new_context, navigate, evaluate, click) against 1.40, 1.45, 1.50
and 1.54 and passed on all four, so the floor drops back to 1.40 and anyone on an
older client keeps working. Upper cap stays at the tested 1.61.0.
2026-07-24 14:13:26 +02:00
feder-cr 06815c9afb deps: cap Playwright at the latest tested version (<=1.61.0), bump 0.3.3
The upper bound was an open <1.62, which would let an untested future 1.61.x (or
anything below 1.62) install and potentially break a fresh setup the way 1.61
first did. Cap it at the exact version validated against this binary, 1.61.0, so
only versions we have tested can be pulled in. The cap moves forward on purpose,
once a newer Playwright is validated against the binary.
2026-07-24 13:24:47 +02:00
feder-cr 422a901104 tests: derive the expected Firefox version from the constant, not a literal
The release e2e tests asserted the binary reported 'Firefox 150' / 'Firefox/150'
and went red the moment firefox-18 (FF151) landed - the binary correctly reports
151.0. Same class as test_constants, but these live in the e2e workflow (not the
unit run, which stayed green), so they slipped through. Now derived from
FIREFOX_UPSTREAM_VERSION so they track whatever the wrapper actually ships.
2026-07-24 12:58:24 +02:00
feder-cr aaf7ee406f deps: allow Playwright up to 1.61 (firefox-18 / Firefox 151), bump 0.3.2
The cap was 1.55.x because 1.61 pairs with Firefox 151 and sent viewport fields
the old binary rejected. firefox-18 rebases onto 151, so the range moves to
>=1.55,<1.62 and playwright_pin.txt to 1.61.0. Both ends tested against the new
binary: 1.61 ran the full browser suite on Windows and Linux, 1.55 is protocol
drift-free. The upper bound stays exclusive so the next minor must be tested.
2026-07-24 09:51:14 +02:00
feder-cr 59b8714737 docs: drop a protection-vendor name from an issue template and a docstring
Neither mention was functional (the issue template is prose; the docstring
describes a cookie_profile category - the actual tag values are unchanged). Keep
the description generic.
2026-07-24 09:51:14 +02:00
feder-cr baf5522d2b font gate: check the faces actually load, not just that the family enumerates
The gate counted 72 families enumerating and passed while ten collection faces
silently fell back to another family, so a real rendering regression shipped
with the gate green. It now renders a CJK probe per collection face and compares
the metrics against the fallback, with the family list calibrated on a build
known to load them.

Also: test_constants derives the expected archive name from the basename
constant instead of hardcoding the version, since a hardcoded one turns every
upstream bump into a mechanical test edit, which is how a stale expectation gets
corrected without anyone checking the asset exists. And INVPW_TRUE_HEADLESS=1
opts into real headless for long unattended runs on Windows, where the default
cloak path intermittently hangs on launch with a persistent profile. The default
is unchanged and the fingerprint prefs are identical either way.
2026-07-23 19:07:28 +02:00
feder-cr aa7277a1ef docs(readme): self-host the LinkedIn badge SVG too (removes the last shields.io dependency) 2026-07-19 14:47:47 +02:00
feder-cr 5026a98dec docs(readme): self-host badges as repo SVGs (no more shields.io)
The version/stars/downloads badges routed through shields.io and GitHub's
image proxy, which rate-limits and intermittently rendered them as broken
images. These are now static SVGs committed under docs/badges/ and referenced
by relative path, so they render like any repo asset and cannot break.
2026-07-19 14:32:09 +02:00
feder-cr cafbbca82f docs(readme): replace flaky dynamic badge with a static Firefox version badge
The github v/release badge (no releases on this repo) and the github stars
badge (shields.io shares a rate-limited GitHub API call, so it intermittently
rendered as a broken image) are replaced by a static Firefox 150.0.1 badge that
never calls an API and cannot break.
2026-07-19 14:15:15 +02:00
feder-cr e09cc07f69 fix(deps): pin playwright to 1.55.x, bump 0.3.1
Playwright 1.61 adds an isMobile field to the Browser.setDefaultViewport
Juggler command that the FF150 binary does not accept, which breaks the
session (#48). Narrow the range from >=1.40,<1.61 to the CI-tested 1.55.x
(scripts/playwright_pin.txt), so a fresh install always gets a compatible client.
2026-07-13 23:09:26 +02:00
feder-cr a1b75d93e9 tests: drop font-sampling tests
Follows the invisible_core removal of the dead per-profile font-sampling:
delete the derive_font_prefs/derive_font_whitelist tests, the 'fonts' pin
tests, and the profile font_whitelist assertions. Suite green (444 passed).
2026-07-06 21:36:26 +02:00
feder-cr 47a1044733 style: ASCII-only comment in the font-env test (drop em-dashes) 2026-07-06 04:19:37 +02:00
feder-cr 3f5a26a9e8 test: adapt integration tests to the self-contained font binary
The binary is now bundle-only and self-contained for fonts, so the config
pipeline emits no font prefs. Drop the two font keys from REQUIRED_KEYS and
rewrite IT7 to assert the pipeline emits NO font.* / font.name-list.* prefs
(it previously asserted the removed fontlist propagation). Matches the
invisible_core change that stopped emitting the font block.
2026-07-06 04:11:46 +02:00
feder-cr a0a0cc2369 scripts: ci_font_gate.py - assert the Windows font persona on every OS
Companion to ci_drive_gate.py, run by release.yml's gate job on each leg's
native runner. Launches the built binary headless, enumerates the visible font
families with the width probe web detectors use, and asserts: the detected set
equals the canonical Windows family set (identical on every OS), no known host
family (macOS Helvetica Neue/Menlo, Linux DejaVu/Ubuntu, ...) is visible, and
the CSS generics resolve to Windows fonts (serif=Times New Roman, mono=Consolas,
system-ui=Segoe UI). This is how the macOS build gets font-validated - there is
no local Mac. No proxy, no secrets.
2026-07-06 03:50:56 +02:00
feder-cr 029b678964 fonts: stop injecting STEALTHFOX_FONTLIST/SYSTEMUI env (binary self-contained)
The patched binary is always bundle-only and needs no external font config, so
the wrapper no longer injects any font env in _build_env (sync + async). No
external font customization channel remains. Test updated.
2026-07-06 03:09:35 +02:00
feder-cr d3462cca47 test(download): point release-URL mocks at firefox_antidetect_patch
The firefox-14 relocation moved the binary release assets to
firefox_antidetect_patch, but test_download and test_constants still mocked
and asserted the old invisible_playwright release URLs, so they failed
against the current invisible-core. Derive the ensure_binary mock URLs from
RELEASE_URL_TEMPLATE so they track core automatically, and update the two
literal-URL guards to the new repo. Parser and non-api-url tests unchanged.
471 unit tests green.
2026-07-05 17:22:01 +02:00
feder-cr 17bab0cca4 ci: move the binary-release workflows to firefox_antidetect_patch
The release/verify-assets/verify-cloak/republish workflows now live on the
source repo (feder-cr/firefox_antidetect_patch), so the built binaries are
published there — the natural home next to the source they are built from,
and reachable the same way by every consumer of invisible-core.

The wrapper keeps its own test workflows (tests/e2e/webrtc-e2e/
firefox-launch-matrix) and the scripts the source-side release jobs check
out from here (ci_drive_gate.py, gen_release_notes.py, playwright_pin.txt,
tests/test_cloak.py).
2026-07-04 20:00:27 +02:00
feder-cr 3c018f7bbf docs: source repo renamed invisible_firefox -> firefox_antidetect_patch (release notes + CI refs) 2026-07-04 20:00:27 +02:00
feder-cr 310bb215df Allow the invisible-core git dependency to install
Hatchling refuses a direct-reference dependency (invisible-core @ git+...)
unless allow-direct-references is opted in, so a clean pip install from git
failed at metadata generation. Enable it so the wrapper installs.
2026-07-03 21:15:20 +02:00
feder-cr 76e41e2789 Split pure-config into invisible-core; keep back-compat shims
The seed->fingerprint->prefs logic, binary download, and proxy/geo config
now live in a standalone invisible-core package (zero Playwright), so a
profile manager can reuse it without pulling Playwright in. The wrapper
depends on invisible-core and replaces the moved modules with full-alias
shims: existing imports (public API, submodules, private names) and
isinstance checks keep working unchanged. tests/test_backcompat.py locks
that contract (6 guards). Bumps to 0.3.0.
2026-07-03 19:57:49 +02:00
feder-cr d434ee4059 docs: bigger logo in banner 2026-07-03 05:13:30 +02:00
feder-cr bb6305b439 docs: center the banner 2026-07-03 05:07:35 +02:00
feder-cr 6a48fb6022 docs: more gap in banner (logo further right) 2026-07-03 05:02:36 +02:00
feder-cr c9853961d3 docs: title+logo banner lockup (light/dark, responsive image) 2026-07-03 04:56:00 +02:00
feder-cr b93fc25a3f docs: title/logo lockup via table (vertically centered) 2026-07-03 04:30:31 +02:00
feder-cr 993ec95eb2 docs: badges on top, then title-left + logo-right, centered intro below 2026-07-03 04:22:05 +02:00
feder-cr 8695a6a4e0 docs: restore lockup layout with large title (logo right of title) 2026-07-03 04:21:04 +02:00
feder-cr 1f087fd6d3 docs: centered hero (fixes tablet title wrap, borderless h3 title) 2026-07-03 03:11:33 +02:00
feder-cr 036076a3dd docs: HTML title (test borderless) 2026-07-03 03:06:50 +02:00
feder-cr 17d67e067c docs: center tagline as a subtitle, clear float 2026-07-03 03:02:54 +02:00
feder-cr faec39c6ab docs: move badges above the title 2026-07-03 01:51:23 +02:00
feder-cr 4458fa585c docs: left-aligned title with logo floated right (lockup style) 2026-07-03 01:36:49 +02:00
feder-cr 163ac7f787 docs: move LinkedIn badge from header to author footer 2026-07-03 01:30:11 +02:00
feder-cr 3d36af5ef6 docs: use HTML badges so they render centered + update logo 2026-07-03 01:20:46 +02:00
feder-cr a59d008a43 docs: add project logo to README 2026-07-03 01:15:03 +02:00
feder-cr 233f4b088f ci: skip the heavy e2e on docs-only pushes (paths-ignore) 2026-07-02 00:17:03 +02:00
feder-cr e1de4c3d96 docs: re-add stars badge in the reliable plain format (Skyvern-style) 2026-07-01 16:25:42 +02:00
feder-cr daf84f78cd docs: drop GitHub stars badge (redundant + flaky; big repos don't use one) 2026-07-01 16:21:08 +02:00
feder-cr bf302701c6 docs: fix stars badge (drop flaky social/.svg format) 2026-07-01 16:17:11 +02:00
feder-cr dd59c41bb5 docs: title + full subtitle 2026-07-01 04:01:46 +02:00
feder-cr 24ad6e4233 docs: shorten title 2026-06-30 20:27:22 +02:00
feder-cr 7914f3d006 docs: single-line title 2026-06-30 20:25:40 +02:00
feder-cr 050ec1aa61 docs: subtitle uses 'passes' 2026-06-30 20:24:42 +02:00
feder-cr 07a812c1f2 docs: short title + concise subtitle 2026-06-30 20:24:23 +02:00
feder-cr 1c942713aa docs: trim title 2026-06-30 19:45:35 +02:00
feder-cr acc5c27d5b docs: make the title a one-line description 2026-06-30 19:45:08 +02:00
feder-cr 4cbe475473 docs: short title + concise description subtitle 2026-06-30 19:44:02 +02:00
feder-cr 1b22e1bb4a docs: put badges above the title 2026-06-30 19:36:59 +02:00
feder-cr 9ad2b1eee6 docs: drop Firefox version badge, merge LinkedIn into the badge row 2026-06-30 19:35:54 +02:00
feder-cr dbffc52570 docs: shorten hero to a single line 2026-06-30 19:33:38 +02:00
feder-cr 81849a32d2 docs: refine hero tagline 2026-06-30 19:32:51 +02:00
feder-cr e4c31427e3 docs: tighten hero tagline 2026-06-30 19:29:34 +02:00
feder-cr f26df624c4 docs: trim hero tagline 2026-06-30 19:28:36 +02:00
feder-cr 4f882b550f docs: hero opens with the project name 2026-06-30 19:27:33 +02:00
feder-cr 74ad6d0fce docs: hero tagline reflects both pillars (real browser + human behavior) 2026-06-30 19:11:45 +02:00
feder-cr cfa33e8756 docs: rewrite How it works around the two-question model (real browser + human behavior) 2026-06-30 19:07:26 +02:00
feder-cr d85e407bbc docs: remove the How it compares section (clutter) 2026-06-30 04:00:07 +02:00
feder-cr 475cb3f4fc docs: swap order of How it compares and the proxy section 2026-06-30 03:58:53 +02:00
feder-cr eeddb8fcde docs: promote the proxy section to a top-level heading 2026-06-30 03:56:03 +02:00
feder-cr 7e06d60f04 docs: truthful proxy framing (public/known IPs, not datacenter) 2026-06-30 01:47:09 +02:00
feder-cr 92b374a497 docs: bulleted How it works, bridge to solution, drop the suites claim 2026-06-30 01:38:52 +02:00
feder-cr fa869c52b8 docs: merge the C++ paragraph into the intro (drop the subheading) 2026-06-30 01:30:10 +02:00
feder-cr 7a42984158 fix(deps): cap playwright <1.61 and pin it in the e2e clean venv
Playwright 1.61.0 (2026-06-29) ships a Browser.setDefaultViewport Juggler
call the published firefox-13 binary does not implement, so an unpinned
pip install (the wrapper declared playwright>=1.40) breaks new_context on
fresh installs. Cap the dependency to <1.61 and force the blessed pin in
the e2e clean venv so CI tests the version users actually run.
2026-06-30 09:00:00 +00:00
feder-cr 95b1e47e0c docs: align Proxies usage note to 90/10 for consistency 2026-06-29 18:07:13 +02:00
feder-cr 62007c21d8 docs: rewrite How it works (browser undetectable, proxy is the remaining variable) 2026-06-29 18:06:46 +02:00
feder-cr 6cca6b3a69 docs: sharpen the proxy framing (99% already flagged as proxies) 2026-06-29 17:48:35 +02:00
feder-cr 3046ca17d3 docs: phrase sx.org as a recommendation, not a partnership 2026-06-29 17:46:21 +02:00
feder-cr 2aa14d9b5b docs: drop the competitor-naming intro line in How it compares 2026-06-29 17:44:21 +02:00
feder-cr 0b5edf4e35 docs: note proxy partner in the Proxies usage section 2026-06-29 17:37:50 +02:00
feder-cr 0e6b0dddfe docs: add proxy partner note to How it works 2026-06-29 17:32:29 +02:00
feder-cr 2184f6f3c2 docs: restore C++ paragraph content, remove em-dashes 2026-06-25 04:32:32 +02:00
feder-cr d35ac458a7 docs: remove LLM phrasing throughout README 2026-06-25 04:31:47 +02:00
feder-cr 567d921d5f docs: merge and trim C++ patch paragraphs 2026-06-25 04:30:01 +02:00
feder-cr 0b54484b63 docs: remove auth implementation detail from README 2026-06-25 04:28:44 +02:00
feder-cr be940b0084 docs: remove preferences line from README 2026-06-25 04:27:32 +02:00
feder-cr 29df4e873c docs: shorten Chromium point in README 2026-06-25 04:26:40 +02:00
feder-cr 9b9e63972c docs: add educational disclaimer to README 2026-06-25 04:25:03 +02:00
feder-cr 168179eb03 docs: remove LLM phrasing from README 2026-06-25 04:23:59 +02:00
feder-cr 02b5f397ad docs: rewrite SECURITY.md, add disclaimer, remove LLM language 2026-06-25 04:22:39 +02:00
feder-cr 82eb22634e chore: remove LLM-style phrasing from issue templates 2026-06-25 04:16:47 +02:00
feder-cr 929c30219f chore: remove security vulnerability contact link from issue config 2026-06-25 04:15:08 +02:00
feder-cr 01d56601ae chore: remove feature request issue template 2026-06-25 04:14:05 +02:00
feder-cr b00bd74a9e chore: remove firefox source bug link from issue config 2026-06-25 04:08:24 +02:00
feder-cr 64641db82e chore: update stealth detection issue template
- add Firefox revision field
- replace verbose verdict field with reproduction script
- rename snippet label to Reproduction script
2026-06-25 04:07:07 +02:00
feder-cr 74b674516b fix(fonts): core pool uses the real Win11 family "franklin gothic medium"
The pool had the bare "franklin gothic", which isn't a real Win11 family and
wouldn't match the bundled franklingothic_x.ttf, so the always-present standard
fonts test failed and the family could drop off the whitelist. Use the real
name (the bundle reconciliation already maps it).
2026-06-24 09:37:11 +02:00
feder-cr 2bc52f4a61 Pin firefox-13: geo-aware locale/Intl + Windows font bundle + audio gate
firefox-13 ships the bundled Windows fonts, makes navigator.languages /
Accept-Language / the Intl locale all follow the proxy country, and gates the
audio fingerprint noise off. The prefs.py change that emits the new font/locale
prefs needs this binary, so the bump and that change land together.
2026-06-24 09:33:45 +02:00
feder-cr 3c0efa2d4f Geo-aware locale, audio noise off, font prefs for the bundled-font binary
locale defaults to "auto" and resolves from the proxy egress country the same
way timezone does - it reuses the egress IP, maps the country to a BCP-47 locale
with the offline mmdb, and falls back to en-US. prefs emit juggler.locale.override
(the full Accept-Language list) so the binary keeps navigator.languages and the
Intl default locale in sync.

The audio fingerprint noise is off in the baseline. Font prefs match the new
binary: the sampled whitelist drives font.system.whitelist, system-ui is Segoe
UI, the bundled fonts are activated, and the CSS generics are pinned to Windows
defaults so they resolve on a non-Windows host too.
2026-06-23 17:51:58 +02:00
feder-cr 8f4b20a19d Pin firefox-12: cross-OS render parity + always-present standard fonts
- BINARY_VERSION -> firefox-12 (self-calibrating font widths, per-family canvas
  distinctness, render-noise that preserves solid reference renders).
- font_pool: the standard Windows fonts (Calibri, Franklin Gothic, Gadugi,
  Javanese Text, Myanmar Text) move from the per-profile optional set to core,
  so they are always present and the detected font set matches a real Windows
  install on every host. Defensive dedup in derive_font_prefs.
- GPU persona applied on every platform (Linux/macOS present a coherent Windows
  GPU + WebGL params); pool re-rooted on a real-device GPU mix; render seeds
  recalibrated.
- prefs: emit absolute per-family font widths that the binary self-calibrates.
- geoip: always pull the latest mmdb via the releases/latest permalink, checked
  each launch, offline-safe (no pinned tag that can 404).
- tests: per-font canvas distinctness, solid-readback purity under render-noise,
  always-present standard-font invariant, no duplicate families.
2026-06-19 03:19:30 +02:00
feder-cr 6dcdc42c05 Drop the dead zoom.stealth.normalize_date_now baseline pref
The Date.now self-assignment was a stopgap that the page-realm fix (the
automation layer no longer touches the realm's built-ins before page scripts
run) made unnecessary; that binary support was never landed, so the pref is a
no-op on every shipped build. Remove it and its now-inaccurate comment.
2026-06-17 00:48:20 +02:00
feder-cr c34bc33686 Pin the wrapper to firefox-11
Bump BINARY_VERSION firefox-10 -> firefox-11 so first-run fetches the new
patched build (keeps the automation layer out of the page realm's observable
state + synthetic-cursor input realism). Add the Date.now property
normalization to the baseline prefs, paired with the firefox-11 binary's
zoom.stealth.normalize_date_now support.
2026-06-17 00:26:58 +02:00
feder-cr 30a79cefc9 Drive gate: set the realistic newtab prefs so a human-cursor click can't lose the about:newtab race
FF150+Fission auto-loads about:newtab (TopSitesFeed) ~100ms-1s after a tab's
first navigation — a cross-process BC swap that replaces the page. The wrapper
always disables this (prefs.py); the raw-Playwright drive gate did not, so any
action that adds latency (e.g. the human-cursor motion path) let the page vanish
mid-sequence and surfaced as a phantom "waiting for locator" timeout — an
environment artifact, not a binary defect. The gate now launches with the same
newtab-suppression prefs every real run uses.

Add republish.yml: re-gate + publish an existing build run's artifacts without
rebuilding, for when all builds succeeded but a gate/test bug blocked publish.
2026-06-16 23:40:29 +02:00
feder-cr 29262a644e webgl: ship only the GPU buckets that pass tampering_ml + decouple render-noise seed
Cut the per-seed WebGL persona to the two renderer buckets that score clean on
FP Pro tampering_ml across seeds (AMD Radeon R9 200 Series and Intel Arc A750),
weighted 70/30, cross-vendor so the fleet isn't one fixed GPU. Every NVIDIA
bucket and the integrated/ancient Intel buckets are penalised, so they're out.

The canvas/WebGL render-image hash turned out to be the dominant tampering_ml
driver, not the attributes, so the render-noise seed (zoom.stealth.fpp.hw_seed)
is now decoupled from the identity seed and drawn from a calibrated clean pool.
Per-seed determinism and per-user diversity are preserved.

Also in this change:
- audio maxChannelCount is stereo-dominant per class (it reflects the output
  device, not the GPU; the old tables over-emitted 5.1/7.1 surround)
- route discrete Intel Arc desktop cards to a discrete-GPU class (not integrated)
- condition the whole sampled profile on the exposed GPU class via the sampler's
  evidence path, so cores/screen/storage stay coherent with the declared GPU
- apply per-named-font width factors on Windows/macOS so canvas measureText
  widths don't collapse to a single value

12/12 seeds clean on tampering_ml (worst 0.29), bot and anti-detect negative,
and the fingerprint stays identical across repeated runs of the same seed.
2026-06-14 11:53:33 +02:00
feder-cr 2dfa4e7bd7 fix: match stock Firefox TLS ClientHello (drop cipher 0xC009)
The Playwright/Juggler Firefox build re-enables cipher 0xC009
(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA), which retail Firefox 150 does not offer.
That extra (17th) cipher shifted our JA3/JA4 off every real Firefox
(ja4 t13d1717h2 / ja3 6f7889b9 vs stock t13d1617h2 / 6447ab08) — a TLS
fingerprint that matches no real browser, which is itself a consistency tell.
Set security.ssl3.ecdhe_ecdsa_aes_128_sha=false in _BASELINE so JA3/JA4/peetprint
are byte-identical to retail FF150 (verified on tls.peet.ws). Non-breaking: stock
Firefox ships without 0xC009 and works on the whole web.
2026-06-12 17:40:48 +02:00
feder-cr b34ecf2a21 fix: humanize pref namespace + async headless cloak
humanize: the wrapper wrote invisible_playwright.humanize[.maxTime], but the
binary's Juggler reads stealthfox.humanize (PageHandler.js gates the Bezier
mouse path on it). The old name was a dead no-op, so humanize never fired and
every mouse.move teleported the cursor — an automation tell. Renamed across
config.py, launcher.py and async_api.py; the mouse test now asserts the on/off
contrast instead of a false-green moves>=1.

headless (async): InvisiblePlaywright(headless=True) crashed on Windows/macOS.
_resolve_headless called make_virtual_display().start() unconditionally, but on
Win/macOS that returns None (the binary self-cloaks via DWMWA_CLOAK; only Linux
spawns Xvfb), so it died with AttributeError. It also never injected
cloak_prefs(), so the window wouldn't have hidden anyway. Mirror the sync
launcher: guard `if vd is not None` + inject cloak_prefs() when headless on
win32/darwin. Verified on FF150: headless=True loads, exits clean, window fully
hidden (no MainWindowHandle / no taskbar entry).
2026-06-12 17:31:31 +02:00
feder-cr 090baa6155 test: add fpscanner + CreepJS to the offline real-detector gate
Alongside BotD and FingerprintJS, the detector e2e now runs two more FOSS
client-side detectors against the binary, vendored and served from localhost so it
stays offline on CI. fpscanner: assert its engine-agnostic bot rules (webdriver/
selenium/bot-UA/platform/timezone/language) are clean. CreepJS (the Firefox-aware
one): runs fully offline via window.Fingerprint with every non-loopback request
aborted, asserting headlessRating==0 and no JS-proxy stealth tell. The Chrome-only
and GPU-sensitive signals are logged, not asserted, so a software-WebGL CI host
doesn't false-red. Validated against firefox-10: full e2e 130 green.
2026-06-11 20:19:19 +02:00
feder-cr 3f2834d8c2 ci: auto-generate release notes from the invisible_firefox commits
The publish job used a fixed body that still read 'DRAFT - do not publish' on the
live release and listed none of the actual changes. Now the body is built from the
source commits that went into the binary: the build records which invisible_firefox
commit it came from (source-commit.txt), and publish diffs that against the previous
release's recorded commit via the GitHub compare API (no deep clone, no cross-repo
token) to list the user-facing subjects. docs/chore/ci/test commits are filtered out,
and the body ends with 'Built from invisible_firefox @<sha>' for traceability. It's
still a draft - the realness gate and the un-draft flip stay manual (issue #14).
2026-06-11 19:14:45 +02:00
feder-cr b3608771ed release: pin the wrapper to firefox-10
firefox-10 is published: the in-binary headless window cloak (Windows DWMWA_CLOAK,
macOS NSWindow alpha-0, Linux keeps Xvfb) and the WebGL readPixels gamma remap that
clears pixelscan's masking flag. Validated against the built binary — validate_release
(linux+win), full e2e (128 passed), fppro ALL CRITICAL CLEAN, consistency PASS, and the
cloak gate green on all 5 targets (macOS via CGWindowAlpha).
2026-06-11 18:29:07 +02:00
feder-cr c9cc0f1743 test(mouse): widen hover->mouseenter wait to 10s (full-suite load flake)
test_hover_triggers_mouseenter timed out at the old 5s wait when run as part of
the full e2e suite — browser startup + CPU contention occasionally push the
mouseenter past the window. In isolation the event fires in well under a second
(5/5), so this is load-sensitivity, not a real regression. A 10s wait absorbs it
while still failing fast if mouseenter genuinely never fires.
2026-06-11 18:08:11 +02:00
feder-cr a950537f0a ci: macOS gate tolerates the runner's missing WebGL; add verify-cloak
The firefox-10 build gated green on all 5 targets but both macOS gate legs
failed. The cloak/webgl guards hard-required a live WebGL context, and macOS
GitHub runners expose none in the CI session (no software-GL fallback, unlike
Linux llvmpipe and Windows WARP). The cloak renders fine there anyway, which the
non-blank screenshot proves, so on the mac legs the WebGL-present check now
self-skips and the cocoa cloak is validated via the screenshot plus CGWindowAlpha.
The gamma masking guard skips on mac too (platform-agnostic C++, covered on Linux
and Windows).

verify-cloak.yml re-runs these guards against a prior build run's artifacts with
no rebuild, so a test-only fix like this is validated against the real binaries
in minutes instead of a 3h rebuild.
2026-06-11 17:18:02 +02:00
476 changed files with 100671 additions and 15387 deletions

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
# The pre-push hook is a shell script, and git must never hand it to a POSIX
# shell with CRLF line endings: `/bin/sh^M: bad interpreter` is how a gate stops
# running on a machine where nothing else looks wrong. This repo is developed on
# Windows with core.autocrlf=true, so without this line a fresh Windows clone
# gets CRLF in the working tree - and Git-for-Windows' sh is the one that runs it.
#
# The index has always stored LF, so a Linux clone was never affected. That is
# exactly why this was worth pinning rather than leaving to a default that
# happens to be right today.
.githooks/** text eol=lf
# The publish ledger is compared byte for byte across an autocrlf checkout and a
# Linux one. The gate folds CRLF vs LF deliberately, but there is no reason to
# make it do that work.
PUBLISHED.json text eol=lf
Regular → Executable
+46 -22
View File
@@ -1,31 +1,55 @@
#!/bin/sh
# Pre-push hook: blocks push if the test suite isn't fully green.
# Pre-push gate. THE POLICY IS NOT IN THIS FILE - it is `invisible_core.hooks`,
# and this stub exists only to find an interpreter and hand over stdin.
#
# Enable once with:
# It used to be here, in three repositories, as 743 lines of shell that were 207
# identical lines out of 211 between two of them. Nine of the eleven differences
# were accidental: the core ran no pytest, the core set a variable three times
# that only the other two ever read, the core resolved an interpreter and then
# called bare `python` anyway. Every fix landed in whichever copy was open.
#
# What this repository wants gated is declared in its own pyproject, under
# [tool.invisible.hooks]. That is the only per-repo part, and it is data.
#
# Install once with:
# git config core.hooksPath .githooks
#
# Bypass for a known-broken WIP push (NOT for releases):
# git push --no-verify
# The --no-verify flag is the only escape hatch. Use it sparingly and never
# for branches that feed into a release.
# A test in this repo fails in an uninstalled checkout, so nobody has to
# remember. Bypass a known-broken WIP push with `git push --no-verify`; that is
# the only escape hatch, and never for a branch that feeds a release.
set -e
# No `set -e`: exit codes here have to be READ and explained, not turned into a
# silent abort. A gate that dies without a message is the worst shape of all.
echo "[pre-push] running unit + integration tests before push..."
# Run from the repository root regardless of where `git push` was invoked.
cd "$(dirname "$0")/.." || exit 1
# Run from this script's directory so it works regardless of where the user
# invoked git push from.
cd "$(dirname "$0")/.."
# Default pyproject addopts skip slow/e2e. That's the gate we want for every
# push — fast feedback. e2e is reserved for explicit release runs.
if ! python -m pytest -q --tb=short; then
echo ""
echo "[pre-push] TESTS FAILED — push aborted."
echo "[pre-push] Either fix the failure or use 'git push --no-verify' if"
echo "[pre-push] you really know what you're doing (NOT for release branches)."
python_bin=""
for candidate in "$INVISIBLE_GATE_PYTHON" python3 python py; do
[ -n "$candidate" ] || continue
if command -v "$candidate" >/dev/null 2>&1; then
python_bin="$candidate"
break
fi
done
if [ -z "$python_bin" ]; then
echo "[pre-push] REFUSED - no python on PATH, so no gate can run." >&2
echo "[pre-push] Nothing must be pushed past a hook that could not check it." >&2
echo "[pre-push] Set INVISIBLE_GATE_PYTHON to an interpreter and push again." >&2
exit 1
fi
echo "[pre-push] all tests green — push proceeding."
exit 0
# `src` first so a checkout gates itself with the policy in the tree being
# pushed. os.getcwd() rather than $PWD on purpose: under git-bash on Windows
# $PWD is /c/... and Python does not resolve that mount.
# exec, so stdin (the refs git is pushing) reaches the policy untouched.
exec "$python_bin" -c 'import os, sys
sys.path.insert(0, os.path.join(os.getcwd(), "src"))
try:
from invisible_core.hooks import main
except ImportError as exc:
sys.exit("[pre-push] REFUSED - cannot import invisible_core.hooks (%s).\n"
"[pre-push] The pre-push policy lives in invisible-core. This repo is\n"
"[pre-push] either that package (so src/ is not where it should be) or\n"
"[pre-push] pins it exactly (so install it). Either way, nothing is\n"
"[pre-push] pushed past a hook that could not check it." % exc)
sys.exit(main())'
+1 -1
View File
@@ -72,7 +72,7 @@ body:
id: logs
attributes:
label: Extra logs
description: Output of `DEBUG=pw:browser* python yourscript.py 2>&1`. Optional but speeds things up.
description: Output of `DEBUG=pw:browser* python yourscript.py 2>&1`. Optional.
render: text
validations:
required: false
@@ -79,8 +79,8 @@ body:
id: url
attributes:
label: URL
description: The exact URL passed to `page.goto`. Not "the homepage" — the literal string.
placeholder: https://id.sky.com/
description: The exact URL passed to `page.goto`. Not "the homepage", the literal string.
placeholder: https://example.com/login
validations:
required: true
@@ -88,7 +88,7 @@ body:
id: snippet
attributes:
label: Runnable reproduction
description: A complete snippet we can copy, paste, run. Stub creds with placeholders, keep everything else literal.
description: Runnable. Stub creds, keep everything else literal.
render: python
value: |
from invisible_playwright import InvisiblePlaywright
+18 -22
View File
@@ -6,7 +6,7 @@ body:
- type: markdown
attributes:
value: |
Use this when something detects the browser (Fingerprint Pro, CreepJS, BotD, reCAPTCHA, Cloudflare, sannysoft, etc).
Use this when something detects the browser (Fingerprint Pro, CreepJS, BotD, reCAPTCHA, sannysoft, etc).
Bugs in operations (clicks, navigation) go to the site/action template.
Browser failing to start goes to the launch failure template.
@@ -14,10 +14,20 @@ body:
id: version
attributes:
label: Version
description: Output of `python -m invisible_playwright version`.
placeholder: 0.1.7 (binary firefox-7)
validations:
required: true
- type: input
id: firefox_rev
attributes:
label: Firefox revision
description: The `firefox-N` tag the binary was built from (shown in the version output above).
placeholder: firefox-7
validations:
required: true
- type: dropdown
id: os
attributes:
@@ -59,22 +69,7 @@ body:
attributes:
label: Detector name and URL
description: Exact site / service / product that flagged us.
placeholder: Fingerprint Pro — https://demo.fingerprint.com/playground
validations:
required: true
- type: textarea
id: scores
attributes:
label: Detector verdict
description: Paste the relevant flags / scores verbatim. For Fingerprint Pro paste `bot`, `vpn`, `virtual_machine`, `tampering*`, `vm_ml_score`, `suspect_score`. For CreepJS the headless / lies / trust scores. For reCAPTCHA v3 the score number.
render: text
placeholder: |
bot: bad
vpn: true
virtual_machine: true
vm_ml_score: 0.74
suspect_score: 22
placeholder: Fingerprint Pro - https://demo.fingerprint.com/playground
validations:
required: true
@@ -82,15 +77,15 @@ body:
id: screenshot
attributes:
label: Screenshot of the detector result
description: Drag-drop a screenshot of the detector page so we see what you see.
description: Screenshot of the detector result.
validations:
required: true
- type: textarea
id: snippet
attributes:
label: How you launched
description: The InvisiblePlaywright launch + navigation that produced the result above. Redact creds.
label: Reproduction script
description: Runnable. Redact creds.
render: python
value: |
from invisible_playwright import InvisiblePlaywright
@@ -99,6 +94,7 @@ body:
ctx = browser.new_context()
page = ctx.new_page()
page.goto("https://demo.fingerprint.com/playground")
# add any extra steps needed to reach the flagged result
validations:
required: true
@@ -106,7 +102,7 @@ body:
id: expected
attributes:
label: What you expected
description: Most detectors will never give a perfect score for any browser. Tell us what threshold you'd accept (e.g. bot=not_detected, vm_ml_score < 0.3).
description: "e.g. bot=not_detected, vm_ml_score < 0.3"
validations:
required: true
@@ -114,7 +110,7 @@ body:
id: full_report
attributes:
label: Full detector response
description: For Fingerprint Pro paste the JSON from /api/event/v4/ if you have it. For CreepJS paste the full Smart Signals block. Optional but speeds things up a lot.
description: "FP Pro: JSON from /api/event/v4/. CreepJS: Smart Signals block. Optional."
render: json
validations:
required: false
-6
View File
@@ -1,11 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Security vulnerability
url: https://github.com/feder-cr/invisible_playwright/security/advisories/new
about: Report a security issue privately. Do NOT open a public issue.
- name: Bug in the patched Firefox source (C++, IDL, Juggler JS)
url: https://github.com/feder-cr/invisible_firefox/issues
about: Source-level patches in the Firefox fork go in the invisible_firefox repo. Detection results (FpJS, CreepJS, etc.) use the stealth detection template here.
- name: Question or general discussion
url: https://github.com/feder-cr/invisible_playwright/discussions
about: Usage questions, ideas, chat. Bugs and features still go in issues.
@@ -1,47 +0,0 @@
name: Feature request
description: Suggest a new feature or improvement
title: "[feature] "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for the suggestion! Please check that:
- Your idea is **in scope** for this repo (the Python wrapper, sampler, CLI, packaging).
- Changes to the patched Firefox C++ source belong at [feder-cr/firefox-stealth](https://github.com/feder-cr/firefox-stealth) instead.
- You have searched [existing issues](https://github.com/feder-cr/invisible_playwright/issues?q=is%3Aissue) for similar requests.
- type: textarea
id: problem
attributes:
label: Problem
description: What problem does this solve? What can't you currently do, or what is awkward today?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
description: How would the feature work? API sketches, CLI examples, or pseudocode welcome.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Other approaches you thought about and why they fall short.
validations:
required: false
- type: textarea
id: context
attributes:
label: Additional context
description: Links to related issues, prior art in other libraries, screenshots, etc.
validations:
required: false
- type: checkboxes
id: contribute
attributes:
label: Are you willing to contribute?
options:
- label: I'd be willing to open a PR for this if accepted.
required: false
+1 -1
View File
@@ -37,4 +37,4 @@ Describe what you ran:
- [ ] I added or updated tests covering the change.
- [ ] `pytest` passes locally.
- [ ] I updated `README.md` / `docs/` if user-visible behavior changed.
- [ ] My change is in scope for this repo (Python wrapper / sampler / CLI / packaging — not the patched Firefox C++ source).
- [ ] My change is in scope for this repo (Python wrapper / sampler / CLI / packaging - not the patched Firefox C++ source).
+207
View File
@@ -0,0 +1,207 @@
# ─────────────────────────────────────────────────────────────────────────────
# core-on-index.yml - the one question every job in this repo has to answer
# before it can install anything: is the invisible-core version we pin actually
# on the package index?
#
# WHY THIS EXISTS.
# [project].dependencies now carries a real specifier, `invisible-core==N.M.0`,
# instead of a `name @ git+url@ref` direct reference. That was measured to be
# the stronger contract: a direct reference has no version to compare, so
# `pip check` is structurally blind to a violated one, while a real specifier
# makes it exit 1, and a plain `pip install` of this package repairs an
# environment somebody broke by hand. The cost is that every `pip install` in
# this repo now has to RESOLVE that dependency from the index.
#
# The publish order is fixed and non-negotiable: invisible-core is uploaded
# FIRST, its consumers after it - two until invisible_firefox was deleted on
# 2026-08-18, this package since. So there is a window - from the first push
# of this repo to GitHub until the core's first upload - in which every install
# step here cannot possibly succeed, for a reason nobody can fix from inside
# this repository.
#
# WHAT WE DO ABOUT IT, AND WHAT WE REFUSE TO DO.
# The tempting fix is to make the install tolerant: `|| true`, `--no-deps`, or
# a fallback that pulls the core straight from git. All three are worse than a
# red run. `|| true` and `--no-deps` produce a GREEN job that installed nothing
# and tested nothing, which is a lie that survives long after the window has
# closed. The git fallback is worse still: it satisfies the pin by name and
# version with content nobody compared, which is the exact failure mode the
# `==` specifier was adopted to expose.
#
# So this workflow asks the index and reports a verdict, and the callers make
# their real jobs depend on it. Three outcomes, all of them visible:
#
# the project is not on the index at all
# -> the publish window. This job passes, emits a ::warning:: annotation
# on the run page, writes the reason into the run summary, and returns
# available=false. Every caller job is then SKIPPED - grey in the
# checks list, not green - and the summary says in words that no tests
# ran. Nobody can mistake it for a passing build.
#
# the project is on the index and carries the pinned version
# -> available=true. Every caller job runs exactly as it did before this
# file existed. Nothing is weakened, ever.
#
# the project is on the index but NOT at the pinned version
# -> this is not the window. The core has been published, so the pin
# names a version that was never uploaded. Hard failure, red.
#
# Anything ambiguous (index unreachable, malformed answer, no `==` pin in
# pyproject.toml, two of them) is also a hard failure. A gate that answers
# "skip" when it does not know would silently disable this repo's whole CI the
# first time PyPI has a bad minute.
#
# This does NOT stop being useful once the core is published: it is the check
# that catches a pin pointing at a version that does not exist, about 20s
# before the install step would have failed with a resolver wall of text.
# ─────────────────────────────────────────────────────────────────────────────
name: core-on-index
on:
workflow_call:
outputs:
available:
description: >-
"true" when the invisible-core version pinned in pyproject.toml can
be resolved from the package index. Any other value means the caller
must not attempt an install.
value: ${{ jobs.probe.outputs.available }}
pin:
description: The invisible-core version this repo pins.
value: ${{ jobs.probe.outputs.pin }}
permissions:
contents: read
jobs:
probe:
name: is the pinned invisible-core on the index?
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
available: ${{ steps.probe.outputs.available }}
pin: ${{ steps.probe.outputs.pin }}
steps:
# SHA-pinned like e2e.yml: this job decides whether the rest of the repo's
# CI runs at all, so it is the last place to want a moving tag.
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' } # tomllib
- id: probe
shell: bash
run: |
python - <<'PY'
import json, os, re, sys, time, tomllib, urllib.error, urllib.request
DIST = "invisible-core"
PIN_RE = re.compile(
r"\s*(?P<name>[A-Za-z0-9][A-Za-z0-9._-]*)\s*"
r"(?:\[[^\]]*\])?\s*==\s*(?P<version>[^\s;,]+)")
def norm(name):
"""PEP 503: invisible_core and invisible-core are one name."""
return re.sub(r"[-_.]+", "-", name).lower()
def write(path_var, text):
path = os.environ.get(path_var)
if path:
with open(path, "a", encoding="utf-8") as fh:
fh.write(text + "\n")
def die(msg):
print(f"::error title={DIST} pin::{msg}")
write("GITHUB_STEP_SUMMARY",
f"### CI stopped: the {DIST} pin cannot be verified\n\n{msg}\n")
sys.exit(1)
# ---- what do we pin? -------------------------------------------------
try:
deps = tomllib.loads(
open("pyproject.toml", "rb").read().decode("utf-8")
)["project"]["dependencies"]
except Exception as e:
die(f"pyproject.toml has no readable [project].dependencies: {e!r}")
pins = []
for dep in deps:
m = PIN_RE.match(dep) if isinstance(dep, str) else None
if m and norm(m.group("name")) == DIST:
pins.append(m.group("version"))
if len(pins) != 1:
die(f"expected exactly one `{DIST}==X.Y.Z` requirement in "
f"[project].dependencies, found {pins or 'none'}. Either the pin was "
f"loosened, replaced by a direct reference, or duplicated. This gate "
f"will not guess which core the build is supposed to wait for. "
f"Declared: {deps}")
pin = pins[0]
print(f"pyproject.toml pins {DIST}=={pin}")
write("GITHUB_OUTPUT", f"pin={pin}")
# ---- is it on the index? --------------------------------------------
url = f"https://pypi.org/simple/{DIST}/"
req = urllib.request.Request(
url, headers={"Accept": "application/vnd.pypi.simple.v1+json"})
data = unpublished = None
last = ""
for attempt in range(1, 4): # retry transient failures, never guess
try:
with urllib.request.urlopen(req, timeout=30) as r:
data = json.load(r)
break
except urllib.error.HTTPError as e:
if e.code == 404:
unpublished = True
break
last = f"HTTP {e.code}"
except Exception as e:
last = repr(e)
print(f"index probe attempt {attempt}/3 failed: {last}")
if attempt < 3:
time.sleep(5 * attempt)
if data is None and not unpublished:
die(f"could not read {url} after 3 attempts ({last}). That is not a "
f"verdict, so this job fails instead of guessing. Re-run it.")
if unpublished:
msg = (f"{DIST} has never been published to the index. This is the "
f"expected publish window: the core is uploaded first, this "
f"repo's package after it.")
print(f"::warning title={DIST} is not on the index yet::{msg} "
f"NOTHING WAS INSTALLED AND NO TEST RAN in this workflow run.")
write("GITHUB_STEP_SUMMARY",
f"### NO TESTS RAN\n\n{msg}\n\n"
f"Every job in this workflow was **skipped**, not passed. "
f"`pyproject.toml` pins `{DIST}=={pin}`; until that version is on "
f"the index no `pip install` in this repository can resolve, so "
f"there is nothing to run. Publish `{DIST}=={pin}`, then re-run "
f"this workflow - the jobs come back on their own, with no edit "
f"to any file here.\n")
write("GITHUB_OUTPUT", "available=false")
sys.exit(0)
versions = data.get("versions")
if not versions:
die(f"{url} answered but listed no versions. The index API changed shape "
f"or served something unexpected; refusing to turn that into a skip.")
if pin not in versions:
shown = sorted(versions)[-10:] # diagnostics only, so a plain sort
die(f"pyproject.toml pins {DIST}=={pin}, but the index publishes "
f"{len(versions)} version(s) ({', '.join(shown)}) and not {pin}. "
f"{DIST} exists, so this is NOT the "
f"publish window - the pin names a version that was never uploaded. "
f"Fix the pin (workbench: python scripts/sync_core_pin.py) or publish "
f"the core first.")
print(f"{DIST}=={pin} is on the index - the workflow runs normally.")
write("GITHUB_OUTPUT", "available=true")
PY
- name: Say so in the run summary
if: steps.probe.outputs.available == 'true'
run: |
echo "invisible-core==${{ steps.probe.outputs.pin }} is on the index; jobs run normally." \
>> "$GITHUB_STEP_SUMMARY"
+142
View File
@@ -0,0 +1,142 @@
# ─────────────────────────────────────────────────────────────────────────────
# e2e-hunt.yml - gira la suite e2e in CICLO finche' non cattura un impiccamento.
#
# Perche' esiste. Il job e2e si impicca nel 12% delle corse (4 su 33 fra il
# 2026-08-01 e il 08-13) e uccide il job al tetto dei 40 minuti. Al 12% una corsa
# verde non dimostra niente e servono ~18 giri per avere il 90% di probabilita' di
# vederne uno: aspettare che succeda da solo su una PR significa aspettare giorni
# e bruciare il tempo di qualcun altro ogni volta.
#
# E perche' QUI e non in locale, per DUE ragioni diverse a seconda dell'input `os`.
#
# ubuntu-24.04 - l'impiccamento del job viveva li'. CHIUSO il 2026-08-13 con 36
# giri (due cacce da 18): zero impiccamenti, zero ritentativi. Resta come
# controllo di non-regressione.
#
# windows-latest - una domanda diversa e ancora aperta: sulla macchina di
# sviluppo i test di interazione producono ritentativi (41 su 17 giri) e su
# Linux nemmeno uno in 36. Ma quella macchina non era ferma - chi misurava ci
# girava sopra, e piu' tardi ci e' tornato il proprietario - quindi il confronto
# e' CONFUSO fra piattaforma e contesa. Un runner Windows dedicato separa le due
# cose senza chiedere a nessuno di stare fermo sei ore.
#
# Non parte da solo: solo `workflow_dispatch`. Non e' un cancello, e' uno
# strumento di indagine, e non deve entrare fra i contesti richiesti.
# ─────────────────────────────────────────────────────────────────────────────
name: e2e hunt
on:
workflow_dispatch:
inputs:
giri:
description: "Quanti giri al massimo (al 12% ne servono ~18 per il 90%)"
required: false
default: "18"
os:
description: "Dove cacciare. windows-latest risponde a una domanda DIVERSA: i ritentativi dell'interazione visti sulla macchina di sviluppo sono il prodotto o la contesa?"
required: false
default: "ubuntu-24.04"
type: choice
options:
- ubuntu-24.04
- windows-latest
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
hunt:
name: caccia (${{ inputs.os }})
runs-on: ${{ inputs.os }}
# 18 giri da ~6 minuti piu' l'installazione. Generoso di proposito: il tetto
# qui non deve MAI essere la cosa che ferma la caccia, altrimenti torniamo a
# un job ucciso che non spiega niente, che e' il difetto di partenza.
timeout-minutes: 300
# Su Windows GitHub esegue i blocchi `run:` con POWERSHELL, non con bash, e
# il primo lancio su windows-latest e' morto in 5 minuti con un ParserError
# sulla riga `if [ "$RUNNER_OS" = "Linux" ]`. Il blocco era stato eseguito
# prima di spedirlo, come vuole la regola - ma in bash, sulla macchina di chi
# scriveva, cioe' con un interprete diverso da quello del bersaglio.
# Eseguire il blocco non basta: va eseguito con la SHELL del runner.
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install wrapper + test deps (+ pinned Playwright)
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
# Solo Linux: su Windows il browser si lancia sul desktop del runner, e
# `firefox-launch-matrix.yml` dimostra da mesi che li' parte davvero.
- name: System deps (xvfb + Firefox runtime libs)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb
sudo "$(which python)" -m playwright install-deps firefox
- name: Fetch the published firefox binary
run: echo "FF=$(python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: Ciclo finche' non cattura
env:
PYTHONUNBUFFERED: "1"
INVPW_TEST_WATCHDOG_FILE: prove/e2e-watchdog.log
run: |
set -u
giri="${{ inputs.giri }}"
mkdir -p prove/giri
# `prove/` dentro lo spazio di lavoro, non RUNNER_TEMP: su Windows quella
# variabile contiene backslash e non attraversa bash in modo affidabile.
# xvfb solo dove esiste; su Windows il browser va sul desktop del runner.
if [ "$RUNNER_OS" = "Linux" ]; then PRE="xvfb-run -a"; else PRE=""; fi
catturato=0
for n in $(seq 1 "$giri"); do
log="prove/giri/giro_$(printf '%02d' "$n").log"
t0=$(date +%s)
set +e
$PRE python -u scripts/run_e2e.py "$FF" > "$log" 2>&1
code=$?
set -e
dur=$(( $(date +%s) - t0 ))
# Un impiccamento adesso NON e' piu' un job ucciso: la scadenza per
# test lo trasforma in un fallimento, e il banner lo nomina.
if grep -aq "Timeout" "$log" && grep -aq "Stack of" "$log"; then
echo "::error::giro $n: IMPICCAMENTO CATTURATO dopo ${dur}s"
echo "--- l'ultimo test che ha parlato ---"
grep -aE "::.*(PASSED|SKIPPED|FAILED)" "$log" | tail -3
echo "--- lo stack ---"
sed -n '/Timeout/,$p' "$log" | head -60
catturato=1
break
fi
echo "giro $n/$giri: exit=$code, ${dur}s"
done
if [ "$catturato" = "0" ]; then
echo "::warning::$giri giri, nessun impiccamento catturato."
echo "Se il tasso qui e' lo stesso del 12%, la probabilita' di questo"
echo "esito e' $(python -c "print(round(100*0.88**$giri))")%, quindi non e' una prova"
echo "che il difetto non ci sia: e' una misura del tasso con questo campione."
fi
# Il passo fallisce SOLO se ha catturato: cosi' il rosso significa
# "trovato", non "rotto", ed e' il rosso che si va a leggere.
exit "$catturato"
- name: Portare fuori tutte le prove
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: e2e-hunt-${{ inputs.os }}-${{ github.run_id }}-${{ github.run_attempt }}
path: |
prove/giri
prove/e2e-watchdog.log
if-no-files-found: warn
retention-days: 14
+88 -4
View File
@@ -1,17 +1,17 @@
# ─────────────────────────────────────────────────────────────────────────────
# e2e.yml — run the FULL browser-driving e2e suite (the 127 @pytest.mark.e2e)
# e2e.yml - run the FULL browser-driving e2e suite (the 127 @pytest.mark.e2e)
# on GitHub, on every push/PR to main.
#
# Why this can run on CI when the drive-gate had to stay light: the drive-gate
# launched Firefox in true HEADLESS mode, which is content-process unstable on
# the hosted runners (eval-CSP / context-destroyed). The stealth wrapper instead
# launches Firefox HEADED on a real display; under `xvfb-run` (a virtual X
# server) that's exactly what we get on a headless CI box — stable, and the same
# server) that's exactly what we get on a headless CI box - stable, and the same
# thing webrtc-e2e.yml already relies on.
#
# Secret-free, so it's safe in public CI: the binary is the PUBLIC firefox-9
# release (no token), and the webrtc e2e fake a local TCP-only SOCKS. The proxy
# realness gate (fppro / smartproxy) is NOT here — it needs secrets and stays a
# realness gate (fppro through a real proxy) is NOT here: it needs secrets and stays a
# local pre-release gate.
# ─────────────────────────────────────────────────────────────────────────────
name: e2e
@@ -19,16 +19,47 @@ name: e2e
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
pull_request:
branches: [main]
# The same filter as `push` above, which had it and this one did not. A
# docs-only PR (#54, deleting the Pages site) therefore spun up the full
# browser bench, hung, and burned the whole 40-minute timeout on a change no
# test can observe. The filter belongs on BOTH triggers or it is not a filter.
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
workflow_dispatch:
permissions:
contents: read
# One run of this workflow per branch at a time. A newer push cancels the older
# in-flight run as a whole, cleanly, instead of leaving its queued jobs to be
# cancelled one by one - which left the run marked failed even though nothing
# had actually failed. Keyed by workflow + ref so tests and e2e never cancel
# each other; only an older run of THIS workflow on the same branch is replaced.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# The install below resolves `invisible-core==N.M.0` from the package index,
# and the core is published BEFORE this package. This gate answers whether it
# is on the index yet; during that window the e2e job is SKIPPED with the
# reason in the run summary rather than faked green, and once the core is up
# it runs unchanged. See .github/workflows/core-on-index.yml.
core-on-index:
uses: ./.github/workflows/core-on-index.yml
e2e:
name: e2e (linux, xvfb)
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 40
steps:
@@ -49,4 +80,57 @@ jobs:
- name: Fetch the published firefox binary
run: echo "FF=$(python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: Run the full e2e suite under a virtual display
run: xvfb-run -a python scripts/run_e2e.py "$FF"
# PYTHONUNBUFFERED, and it is not a nicety. Without it Python block-buffers
# stdout when it is a pipe, and this step printed NOTHING for 39 minutes
# before the 40-minute timeout killed it on 2026-08-04: a run with no
# verdict and no way to tell where it went. The variable is inherited by
# the pytest subprocess run_e2e.py spawns, which is where the output
# actually comes from.
env:
PYTHONUNBUFFERED: "1"
# Il cane da guardia di tests/conftest.py: a 150s dentro UN test scrive
# QUI lo stack di ogni thread, e lo ripete. Due stack identici dicono
# bloccato, due diversi dicono lento - diagnosi opposte che nessun altro
# strumento distingue. Su FILE e non su stderr perche' pytest redirige i
# descrittori a livello di sistema: cio' che e' catturato si perde
# quando il processo viene ucciso, cioe' nel caso per cui esiste.
INVPW_TEST_WATCHDOG_FILE: ${{ runner.temp }}/e2e-watchdog.log
run: xvfb-run -a python -u scripts/run_e2e.py "$FF"
# Gira SOLO se il passo sopra fallisce, e prima del 2026-08-13 non poteva
# esistere: l'impiccamento veniva ucciso dal tetto dei 40 minuti, quindi il
# job risultava `cancelled` e i passi successivi non partivano affatto. Con
# `--timeout 420 --timeout-method thread` il processo muore a 7 minuti e il
# passo fallisce NORMALMENTE, quindi da qui le prove escono.
# Uno strumento che non si vede e' indistinguibile da uno che non c'e'.
# L'annuncio che il cane da guardia stampa all'apertura del file finisce
# dentro `pytest_runtest_setup`, che pytest CATTURA: nel log del job non
# compare, quindi da qui non si poteva distinguere "armato" da "inerte".
# Questo passo glielo chiede al file, che e' l'unica prova che esista.
- name: Il cane da guardia era armato?
if: always()
run: |
f="${RUNNER_TEMP}/e2e-watchdog.log"
if [ -s "$f" ]; then
# `|| true` e non e' cosmetico: `grep -c` che conta ZERO esce 1, e
# GitHub lancia i blocchi `run:` con `bash -e`. Senza, questo passo
# moriva esattamente sulle corse SANE - quelle con zero stack - cioe'
# avrebbe fatto fallire ogni e2e verde. Trovato eseguendo il blocco
# estratto dallo YAML nei quattro stati, non rileggendolo.
sorvegliati=$(grep -ac '^---' "$f" || true)
stack=$(grep -ac 'Timeout' "$f" || true)
echo "armato: ${sorvegliati} test sorvegliati, ${stack} stack scritti"
else
echo "::warning::il file del cane da guardia e' assente o vuoto: lo strumento NON era armato, e un impiccamento non lascerebbe niente"
fi
# `always()` e non `failure()`: il file serve anche quando la corsa e'
# verde, perche' e' l'unica prova che lo strumento funzioni.
- name: Portare fuori le prove dell'impiccamento
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: e2e-watchdog-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/e2e-watchdog.log
if-no-files-found: warn
retention-days: 14
+46 -18
View File
@@ -1,14 +1,19 @@
name: firefox-launch-matrix
# Cross-Windows-edition smoke for the shipped firefox-N binary.
# Triggered by issue #22 (firefox-7 SxS mismatch on Win11 build 26200,
# reporter `jannusdorfer-create`).
# Cross-Windows-edition smoke for the SEALED binary, on every Windows runner
# GitHub offers, from a fresh checkout.
#
# Runs the exact reporter snippet on every Windows runner GitHub offers,
# from a fresh checkout. If any matrix cell fails the same way, the bug
# is reproducible on at least one clean-ish environment and we ship a
# sidecar mozglue.manifest fix. If all cells pass, the bug is confined
# to the reporter's specific environment (Pro/Enterprise GPO, EDR, etc.).
# HISTORY, and what this can no longer do. It was written for issue #22 (a SxS
# mismatch on Win11 build 26200) and ran the reporter snippet against firefox-7.
# It cannot: a sealed invisible-core serves the sealed tag and refuses every
# other one, so `fetch firefox-7` is a SealMismatch by design now.
#
# It was also SILENTLY WRONG from the seal landing to 2026-07-26: the verify
# step rebuilt the cache path by hand as Cache/firefox-7/firefox.exe while the
# cache is content-keyed (Cache/<tag>_<version>_<buildid>/), so every cell failed
# with NOT FOUND - a failure that looked exactly like the bug under investigation
# and was not. Nine red cells read as "reproduced everywhere". The path now comes
# from `python -m invisible_playwright path`, the only thing that knows it.
on:
workflow_dispatch:
@@ -17,15 +22,34 @@ on:
paths:
- '.github/workflows/firefox-launch-matrix.yml'
# Least privilege: this smoke matrix only checks out the repo and launches
# firefox.exe, so it needs nothing but read access to the contents. Without an
# explicit block the token would default to the repo's broader permissions.
permissions:
contents: read
jobs:
# `pip install .` below resolves `invisible-core==N.M.0` from the package
# index, and the core is published BEFORE this package. This gate answers
# whether it is there yet; during that window the smoke matrix is SKIPPED
# with the reason in the run summary rather than faked green, and once the
# core is up it runs unchanged. See .github/workflows/core-on-index.yml.
core-on-index:
uses: ./.github/workflows/core-on-index.yml
smoke:
name: launch (${{ matrix.os }}, py${{ matrix.python }})
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022, windows-2025, windows-latest]
python: ["3.11", "3.12", "3.13"]
# This is a "does firefox.exe launch" smoke test across Windows versions;
# the Python version does not change the answer, so one is enough. That
# takes this all-Windows (2x-cost) matrix from 9 jobs to 3.
python: ["3.12"]
steps:
- uses: actions/checkout@v4
@@ -57,19 +81,24 @@ jobs:
python -m pip install --upgrade pip
pip install .
- name: Fetch firefox-7 binary
- name: Fetch the sealed binary
run: python -m invisible_playwright fetch
- name: Verify firefox.exe can launch standalone (the snippet that fails for issue #22)
- name: Verify firefox.exe can launch standalone
shell: pwsh
run: |
# The platformdirs path has the duplicated `invisible-playwright` segment
# on Windows (user_cache_dir convention).
$ffPath = "$env:LOCALAPPDATA\invisible-playwright\invisible-playwright\Cache\firefox-7\firefox.exe"
if (-not (Test-Path $ffPath)) {
Write-Error "firefox.exe NOT FOUND at $ffPath"
# ASK for the path, never rebuild it. The cache directory is keyed on
# tag + base version + BuildID, so any string assembled here is a second
# copy of a naming rule that has already moved once - and when it drifts
# the step fails with NOT FOUND, which is indistinguishable from the
# launch bug this job exists to detect.
$ffPath = (python -m invisible_playwright path).Trim()
Write-Host "Package reports: $ffPath"
if (-not $ffPath -or -not (Test-Path $ffPath)) {
Write-Error "firefox.exe NOT FOUND at '$ffPath' (reported by the package)"
exit 1
}
"FF_PATH=$ffPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
Write-Host "Launching: $ffPath --version"
# NOTE: firefox.exe --version on Windows prints the version but may
# return non-zero exit code (sub-process fork quirk). Check stdout.
@@ -100,7 +129,6 @@ jobs:
with:
name: launch-failure-${{ matrix.os }}-py${{ matrix.python }}
path: |
${{ env.LOCALAPPDATA }}/invisible-playwright/invisible-playwright/Cache/firefox-7/firefox.exe
${{ env.LOCALAPPDATA }}/invisible-playwright/invisible-playwright/Cache/firefox-7/mozglue.dll
${{ env.FF_PATH }}
if-no-files-found: warn
retention-days: 7
+68
View File
@@ -0,0 +1,68 @@
# ─────────────────────────────────────────────────────────────────────────────
# publish-wiki.yml - mirror the docs/ site into the GitHub wiki on every release.
#
# The wiki is a SEPARATE git repo (<repo>.wiki.git) with no Jekyll front matter
# and its own _Sidebar.md navigation, so this is a render, not a copy:
# scripts/build_wiki.py strips the front matter, rewrites [x](slug.md) internal
# links to the wiki's extensionless form, names each page by its slug (index.md
# becomes Home.md), and regenerates _Sidebar.md from the parent/nav_order tree.
#
# It runs on a published release (the docs the release ships are what the wiki
# should show) and on manual dispatch. The wiki checkout is wiped and rebuilt
# each run so a page deleted from docs/ also disappears from the wiki; nothing
# but generated output is ever committed.
#
# AUTH. Pushing to <repo>.wiki.git needs contents:write. The built-in
# GITHUB_TOKEN carries it here; if a run ever gets a 403 pushing the wiki
# (some org policies withhold wiki write from GITHUB_TOKEN), set a PAT with
# `repo` scope as the secret WIKI_TOKEN and it is used instead. No long-lived
# credential is committed either way.
name: publish-wiki
on:
release:
types: [published]
workflow_dispatch: {}
permissions:
contents: write
concurrency:
group: publish-wiki
cancel-in-progress: true
jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- name: Check out the repo (docs + the converter)
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Render docs/ into a wiki build directory
run: python scripts/build_wiki.py docs wiki_build
- name: Publish to the wiki
env:
WIKI_PUSH_TOKEN: ${{ secrets.WIKI_TOKEN != '' && secrets.WIKI_TOKEN || github.token }}
run: |
set -euo pipefail
repo="${{ github.repository }}"
git clone "https://x-access-token:${WIKI_PUSH_TOKEN}@github.com/${repo}.wiki.git" wiki
# wipe old generated pages (keep .git) so deletions propagate
find wiki -maxdepth 1 -name '*.md' -delete
cp wiki_build/*.md wiki/
cd wiki
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "wiki already up to date"
else
git commit -m "docs: sync wiki from docs/ (${{ github.ref_name }})"
git push origin HEAD:master
fi
+299
View File
@@ -0,0 +1,299 @@
name: publish
# Publishing invisible-playwright from a tag, with no long-lived credential anywhere.
#
# WHAT REPLACED WHAT. This package was uploaded by hand, from one machine, with a
# long-lived PyPI token sitting on it. Two things follow from that and neither is
# hypothetical: the token is a standing credential whose blast radius is the whole
# project, and a hand-run twine has no gate in front of it - the ordering rules
# live in a person's memory.
#
# The credential here is the `pypi` GitHub Environment's OIDC trust relationship,
# minted per run and valid for minutes. Only the `upload` job names that
# environment, and `upload` declares `needs: gate`, so a red gate means the only
# job that can authenticate never starts. The ordering is a dependency, not a
# convention.
#
# BEFORE THE FIRST RUN, on PyPI: Manage project -> Publishing -> add a GitHub
# publisher with owner `feder-cr`, repository `invisible_playwright`, workflow
# `publish.yml`, environment `pypi`. Until that exists the upload fails with
# `invalid-publisher`, which is the correct failure: nothing has said this
# workflow may speak for this project. Revoke the long-lived token AFTER the
# first successful OIDC publish, not before.
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
jobs:
# Asked of the INDEX, first, because a tag can legitimately name a version that
# is already published: a tag backfilled for a hand-published release, a tag
# re-pushed, a re-run of this workflow. In all of those there is nothing to do
# and nothing wrong, and reaching twine would fail on a filename the index has
# already served - a red run for a situation that is fine.
already-published:
runs-on: ubuntu-latest
outputs:
present: ${{ steps.probe.outputs.present }}
version: ${{ steps.probe.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: probe
shell: bash
run: |
VERSION="$(grep -m1 '^version = ' pyproject.toml | cut -d'"' -f2)"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
CODE=$(curl -s -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/invisible-playwright/$VERSION/json")
case "$CODE" in
200) echo "present=yes" >> "$GITHUB_OUTPUT"
echo "::notice::invisible-playwright $VERSION is already on the index. No-op, not a failure." ;;
404) echo "present=no" >> "$GITHUB_OUTPUT" ;;
*) echo "the index answered $CODE for $VERSION, which is neither present" >&2
echo "nor absent. Refusing rather than guessing." >&2
exit 1 ;;
esac
gate:
needs: already-published
if: needs.already-published.outputs.present != 'yes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: the tag names the version being built
# A tag pointing at a different version publishes something nobody asked
# for, under a name that says otherwise. Skipped on workflow_dispatch,
# where there is no tag to compare against.
if: github.event_name == 'push'
shell: bash
run: |
TAG="${GITHUB_REF_NAME#v}"
HAVE="${{ needs.already-published.outputs.version }}"
if [ "$TAG" != "$HAVE" ]; then
echo "tag v$TAG does not name the version in pyproject.toml ($HAVE)" >&2
exit 1
fi
- name: the pinned invisible-core is ON THE INDEX
# THE ordering rule, as a gate instead of a sentence in a runbook. This
# package declares `invisible-core==X.Y.Z`, so pip resolves the PUBLISHED
# core - and a consumer released against a core that is not there yet is
# red on every runner and broken for every user while passing locally,
# because the workbench core is an editable install and cannot see this
# class of failure at all. Measured 2026-07-28: both consumers moved to a
# name a new core had, neither release could resolve it.
shell: bash
run: |
# BOTH spellings. PEP 503 normalises `invisible_core` and
# `invisible-core` to the same project, and the dependency here is
# written with the UNDERSCORE while every comment about it uses the
# hyphen. Written against the prose first, this grep matched nothing
# and the step exited 1 on a correct pyproject - caught by running it
# by hand before the first release rather than during one.
WANT=$(grep -oE 'invisible[-_]core==[0-9]+\.[0-9]+\.[0-9]+' pyproject.toml | head -1 | cut -d= -f3)
if [ -z "$WANT" ]; then
echo "no exact invisible-core== pin found in pyproject.toml" >&2
echo "(looked for invisible-core== and invisible_core==)" >&2
exit 1
fi
CODE=$(curl -s -o /dev/null -w '%{http_code}' "https://pypi.org/pypi/invisible-core/$WANT/json")
if [ "$CODE" != "200" ]; then
echo "invisible-core $WANT is not on the index (HTTP $CODE)." >&2
echo "Publish the core FIRST, then this package. In this order every" >&2
echo "install resolves; in the other one none of them do." >&2
exit 1
fi
echo "::notice::invisible-core $WANT is on the index"
- name: install the package and its dev extras
# Its own step, BEFORE the arming below: install_hooks.py imports
# invisible_core, and the first version of this file installed inside the
# suite step, so the arming ran against a runner that had nothing
# installed and died on ModuleNotFoundError. ci.yml has had this order
# all along; this workflow had simply never run.
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: arm the pre-push gates
# The suite asserts core.hooksPath is set and a fresh checkout has none.
run: python scripts/install_hooks.py
- name: the suite
# A tag push does not trigger the ordinary test workflow, which runs on
# branches and pull requests. Without this, tagging is a way to publish
# code no job has run.
run: python -m pytest -q
upload:
needs: [already-published, gate]
if: needs.already-published.outputs.present != 'yes'
runs-on: ubuntu-latest
environment: pypi # the trust relationship lives HERE, behind the gate
permissions:
id-token: write # trusted publishing; no token in a secret anywhere
contents: write # to commit the ledger entry back
pull-requests: write # and to open one when protection declines the push
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python -m pip install --upgrade pip build
- run: python -m build
- name: twine check
run: |
pip install twine
twine check dist/*
- uses: pypa/gh-action-pypi-publish@release/v1
- name: record what was published, and commit it back
# The action above holds the OIDC credential and does the upload; the
# thing that writes PUBLISHED.json is invisible_core.release. So the
# first successful run of this workflow published 0.3.1 and recorded
# nothing - re-creating, on its first green run, the exact gap that had
# been back-filled by hand an hour earlier for 0.6.0 and 0.3.0.
#
# Recording the TREE is correct here and only here: this job is checked
# out at the tag, so the tree is what was built and uploaded. A backfill
# of a version published elsewhere must come from the artifacts the index
# serves instead, because the tree has moved on.
run: |
# `-e .` and not `.[dev]`: this is the job holding the OIDC
# credential and `contents: write`, and `record` needs the package
# importable plus a build backend, nothing else. The dev extra
# pulls pytest, ruff and - in the wrapper - the whole of
# Playwright into the one job that can push to main.
python -m pip install --quiet -e . build hatchling
python -m invisible_core.release record
if git diff --quiet -- PUBLISHED.json; then
echo "::warning::nothing recorded - the ledger did not change"
exit 0
fi
# The direct push CANNOT succeed while the branch requires status
# checks: a required check cannot have passed on a commit that does
# not exist yet, and since 2026-08-13 `enforce_admins` is TRUE, so
# not even a maintainer push has a bypass. Measured 2026-08-05 -
# every publish run on all three repos ended in failure with GH006,
# on releases that had shipped. So the push is tried, and when
# declined the entry goes to a branch and a pull request rather than
# nowhere. Green when it is preserved, red only when it is LOST.
#
# THE FALLBACK HAD NEVER RUN ONCE - repaired 2026-08-14, the same fix
# in all three repos. Two defects, and the first hid the second:
#
# 1. `HEAD:$LEDGER_BRANCH` cannot work from the detached HEAD a tag
# build checks out: the destination branch does not exist yet and
# the source is a commit object, so git cannot tell a branch from
# a tag and refuses with "The destination you provided is not a
# full refname". Under `bash -e` that aborts the step, so the
# pull request below was never even attempted and neither
# `::error::` was ever printed - which is why no `ledger/*`
# branch and no pull request has ever existed on any of the three
# repos, across four red runs on releases that had shipped.
# 2. Creating the pull request also needs "Allow GitHub Actions to
# create and approve pull requests" ON THE REPOSITORY, which is
# off on all three. The job's own `pull-requests: write` is
# necessary and not sufficient. So the pull request is BEST
# EFFORT: once the branch push lands the entry is safe, and the
# run does not go red over a convenience that a repository
# setting can withdraw.
VERSION=$(python -c "import json;print(json.load(open('PUBLISHED.json'))['released'][-1]['version'])")
git config user.name "feder-cr"
git config user.email "85809106+feder-cr@users.noreply.github.com"
git add PUBLISHED.json
git commit -m "record $VERSION as published"
BRANCH="${{ github.event.repository.default_branch }}"
if git push origin "HEAD:refs/heads/$BRANCH"; then
echo "::notice::ledger entry for $VERSION committed to $BRANCH"
exit 0
fi
echo "the direct push was declined; falling back to a branch and a pull request"
LEDGER_BRANCH="ledger/$VERSION"
if ! git push -f origin "HEAD:refs/heads/$LEDGER_BRANCH"; then
echo "::error::the ledger entry for $VERSION reached NEITHER $BRANCH NOR a branch of its own. It exists only in this run. Back-fill it by hand from the artifacts the index serves, or the next release is refused over a missing entry."
exit 1
fi
echo "::notice::the ledger entry for $VERSION is preserved on branch $LEDGER_BRANCH"
CODE=$(curl -s -o /tmp/pr.json -w '%{http_code}' -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/pulls" \
-d "{\"title\":\"record $VERSION as published\",\"head\":\"$LEDGER_BRANCH\",\"base\":\"$BRANCH\",\"body\":\"The upload succeeded and the ledger could not be pushed to $BRANCH directly: branch protection declines this token, which has no bypass. Merging this keeps the next release from being refused over a missing entry.\"}")
if [ "$CODE" = "201" ] || [ "$CODE" = "422" ]; then
echo "::error::the ledger for $VERSION is NOT on $BRANCH. Branch $LEDGER_BRANCH carries it and a pull request is open (HTTP $CODE; 422 means one already exists). Merge it before the next release."
else
echo "::error::the ledger for $VERSION is NOT on $BRANCH. Branch $LEDGER_BRANCH carries it and the pull request could NOT be created (HTTP $CODE - 403 means the repository forbids Actions from creating pull requests). Open and merge it by hand before the next release."
fi
exit 0
- name: create the release page for this tag
# Measured 2026-08-11: after pushing three tags, FOUR versions out of four
# had no release page, and it was this repo's own gate
# (`test_the_published_version_has_a_github_release`, in
# `test_release_e2e.py`) that found them AFTER publication. A tag with no
# release page is not cosmetic: that gate walks EVERY version on the
# index, so one omission refuses a later run for a version nobody is
# releasing that day.
#
# Runs only on the tag path - `workflow_dispatch` has no tag to describe.
# Idempotent on purpose: a re-pushed tag, a re-run, or a page created by
# hand must all be a no-op rather than a failure, which is the same rule
# `already-published` follows one job up.
#
# The body comes from CHANGELOG.md when the repo keeps one (only this one
# does) and is generated otherwise. One step, both cases, so the three
# repos carry the same text instead of three variants that drift.
if: startsWith(github.ref, 'refs/tags/')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${GITHUB_REF#refs/tags/}"
VERSION="${TAG#v}"
if gh release view "$TAG" > /dev/null 2>&1; then
echo "::notice::the release page for $TAG already exists - nothing to do"
exit 0
fi
if [ -f CHANGELOG.md ]; then
awk -v v="$VERSION" '
$0 ~ ("^## \\[" v "\\]") { p = 1; next }
p && /^## \[/ { exit }
p { print }
' CHANGELOG.md > /tmp/notes.md
else
: > /tmp/notes.md
fi
# A body that is only whitespace reads as a page nobody wrote. Say what
# is true instead: the version, and where the artifacts actually are.
#
# The PyPI name is the repository name with hyphens: the repo is
# `invisible_playwright` and the project is `invisible-playwright`.
# PyPI redirects the underscore form, so getting this wrong would have
# produced a link that works and is still wrong to read. And no
# backticks in the body - they would be command substitution inside a
# double-quoted shell string, which is how fourteen quoted terms once
# became empty strings.
PKG=$(printf '%s' "${{ github.event.repository.name }}" | tr '_' '-')
if [ -z "$(tr -d '[:space:]' < /tmp/notes.md)" ]; then
printf '%s\n' \
"$PKG $VERSION is on PyPI." \
"" \
"Artifacts and checksums: https://pypi.org/project/$PKG/$VERSION/" \
> /tmp/notes.md
fi
if gh release create "$TAG" --title "$TAG" --notes-file /tmp/notes.md; then
echo "::notice::release page created for $TAG"
exit 0
fi
echo "::error::the release page for $TAG could not be created. The package IS published; create the page by hand or a later run of the release gate will refuse over it."
exit 1
-424
View File
@@ -1,424 +0,0 @@
# ─────────────────────────────────────────────────────────────────────────────
# release.yml — build all 5 patched-Firefox targets at $0 and publish them as
# DRAFT GitHub Release assets, named per the wrapper contract (constants.ARCHIVE_NAME).
# DRAFT on purpose: a human runs the realness gate and only THEN un-drafts + bumps
# BINARY_VERSION. Nothing auto-ships (issue #14 lesson).
#
# PACKAGING (issue #14: dangling symlinks broke 265 downloads — never again):
# Linux → cp -aL (dereference ALL symlinks into real files) + rm dev tools +
# strip + sanitize + tar at ROOT, then validate_release.py as a HARD
# in-pipeline gate (the exact battle-tested script from the source repo).
# Win → mach package; zip the CONTENTS of dist/firefox (clean tree, NOT
# dist/bin) so firefox.exe sits at the zip ROOT.
# macOS → mach package; ad-hoc codesign the .app; PRESERVE its internal relative
# symlinks (a .app legitimately has them — cp -aL would break it); verify
# every symlink is relative+internal; tar the bundle. --version self-gate.
#
# DRIVE GATE (the firefox-8 catcher): after build, every binary is DRIVEN by
# Playwright on its native runner (launch via juggler + real page + JS roundtrip,
# headless, no screenshot → GPU-free, zero proxy). A juggler-less binary renders
# a screenshot fine but is undrivable — only an actual drive catches that. The
# proxy realness gate (fppro/webrtc) stays LOCAL — it needs secrets.
#
# Trigger: push a tag `firefox-N`, or run manually. Hybrid runners, all free.
# ─────────────────────────────────────────────────────────────────────────────
name: release
on:
push:
tags: ['firefox-*']
workflow_dispatch:
inputs:
source_ref:
description: 'invisible_firefox ref to build'
default: 'stealth/150'
release_tag:
description: 'release tag to publish the draft under (e.g. firefox-9)'
required: true
env:
SOURCE_REPO: feder-cr/invisible_firefox
SOURCE_REF: ${{ github.event.inputs.source_ref || 'stealth/150' }}
jobs:
build:
name: build-${{ matrix.leg }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 350
strategy:
fail-fast: false
matrix:
include:
- leg: linux-x86_64
runner: ubuntu-24.04
family: linux
target: ''
rust_target: x86_64-unknown-linux-gnu
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-linux-x86_64.tar.gz
- leg: linux-arm64
runner: ubuntu-24.04-arm
family: linux
target: ''
rust_target: aarch64-unknown-linux-gnu
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-linux-arm64.tar.gz
- leg: win-x86_64
runner: ubuntu-24.04
family: win
target: x86_64-pc-windows-msvc
rust_target: x86_64-pc-windows-msvc
win_disables: 'yes'
extra_pkgs: 'msitools p7zip-full zip'
asset: firefox-150.0.1-stealth-win-x86_64.zip
- leg: macos-arm64
runner: macos-15
family: mac
target: aarch64-apple-darwin
rust_target: aarch64-apple-darwin
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-macos-arm64.tar.gz
- leg: macos-x86_64
runner: macos-15-intel
family: mac
target: x86_64-apple-darwin
rust_target: x86_64-apple-darwin
win_disables: 'no'
extra_pkgs: ''
asset: firefox-150.0.1-stealth-macos-x86_64.tar.gz
steps:
- name: Free disk + 16G swap (Linux runners)
if: matrix.family != 'mac'
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
/usr/local/share/boost "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}" 2>/dev/null || true
sudo fallocate -l 16G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile || true
- name: Checkout patched Firefox source
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
repository: ${{ env.SOURCE_REPO }}
ref: ${{ env.SOURCE_REF }}
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install Linux build tools
if: matrix.family != 'mac'
run: |
sudo apt-get update
sudo apt-get install -y util-linux binutils ${{ matrix.extra_pkgs }}
- name: Select Xcode 26.2 + export SDK path (macOS)
if: matrix.family == 'mac'
run: |
sudo xcode-select -s /Applications/Xcode_26.2.app
SDKP="$(xcrun --show-sdk-path)"
echo "SDK_PATH=$SDKP" >> "$GITHUB_ENV"
echo "macOS SDK $(xcrun --sdk macosx --show-sdk-version) at $SDKP"
- name: Add Rust target
run: rustup target add ${{ matrix.rust_target }} || true
- name: Extend the repo .mozconfig (NO mold; +target/SDK as needed)
run: |
test -f .mozconfig || { echo "ERROR: no .mozconfig in source"; exit 1; }
rm -f mozconfig
{
echo ""
echo "# --- release CI levers for ${{ matrix.leg }} (mold intentionally OFF — it segfaults libxul) ---"
echo "ac_add_options --disable-debug-symbols"
} >> .mozconfig
if [ -n "${{ matrix.target }}" ]; then echo "ac_add_options --target=${{ matrix.target }}" >> .mozconfig; fi
if [ "${{ matrix.family }}" = "mac" ]; then echo "ac_add_options --with-macos-sdk=$SDK_PATH" >> .mozconfig; fi
if [ "${{ matrix.win_disables }}" = "yes" ]; then
{ echo "ac_add_options --disable-default-browser-agent";
echo "ac_add_options --disable-maintenance-service";
echo "ac_add_options --disable-update-agent"; } >> .mozconfig
fi
if [ "${{ matrix.family }}" = "mac" ]; then NCPU=$(sysctl -n hw.ncpu); else NCPU=4; fi
{ echo "mk_add_options MOZ_PARALLEL_BUILD=$NCPU";
echo "mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-rel"; } >> .mozconfig
echo "----- final .mozconfig -----"; cat .mozconfig
- name: Build
run: ./mach build
# ── LINUX: dereference symlinks (issue #14) + strip + sanitize + tar@root + GATE
- name: Package + validate (Linux)
if: matrix.family == 'linux'
run: |
set -e
DIST=obj-rel/dist/bin
STAGING=staging
rm -rf "$STAGING"; mkdir -p "$STAGING" out
cp -aL "$DIST/." "$STAGING/" # -L: dereference ALL symlinks into real files
N=$(find "$STAGING" -type l | wc -l)
[ "$N" -eq 0 ] || { echo "ERROR: $N symlinks remain after cp -aL"; exit 1; }
for t in xpcshell certutil pk12util rapl; do rm -f "$STAGING/$t"; done
# JUGGLER GATE: the binary is undrivable by Playwright without it (see 70-known-bugs)
{ [ -e "$STAGING/chrome/juggler.manifest" ] && [ -d "$STAGING/chrome/juggler" ]; } \
|| { echo "ERROR: juggler missing from package (chrome/juggler) — Playwright can't drive it"; exit 1; }
echo "juggler GATE OK (loose chrome/juggler present)"
find "$STAGING" -type f \
\( -name '*.so' -o -name firefox -o -name firefox-bin -o -name plugin-container \
-o -name pingsender -o -name glxtest -o -name vaapitest -o -name updater \) \
-exec strip --strip-debug {} + 2>/dev/null || true
STAGING="$STAGING" python3 scripts/linux_sanitize.py || true # no-op in CI (no /home/feder), defensive
tar --owner=0 --group=0 --numeric-owner --mtime="2026-01-01 00:00:00 UTC" \
-czf "out/${{ matrix.asset }}" -C "$STAGING" . # firefox at ROOT
echo "=== HARD GATE: scripts/validate_release.py (the issue-#14 protector) ==="
python3 scripts/validate_release.py --linux "out/${{ matrix.asset }}" --linux-only
ls -la out/
# ── WINDOWS (cross): zip the CLEAN dist/firefox tree, firefox.exe at root
- name: Package (Windows cross)
if: matrix.family == 'win'
run: |
set -e
# Do NOT swallow a mach failure: `./mach package || echo` lets set -e pass
# and would fall through to a stale tree. A release MUST come from the clean
# dist/firefox; dist/bin is the dev tree (cruft + loose juggler that masked
# the firefox-7/8 packaging bugs), never acceptable for a release.
./mach package
[ -f obj-rel/dist/firefox/firefox.exe ] \
|| { echo "ERROR: mach package did not produce a clean dist/firefox tree"; exit 1; }
WIN_APP=obj-rel/dist/firefox
echo "packaging from: $WIN_APP"
# JUGGLER GATE: omni.ja must carry juggler (else Playwright can't drive it)
[ -f "$WIN_APP/omni.ja" ] || { echo "ERROR: no omni.ja in $WIN_APP"; exit 1; }
python3 -c "import zipfile,sys; sys.exit(0 if any('juggler' in n.lower() for n in zipfile.ZipFile('$WIN_APP/omni.ja').namelist()) else 1)" \
|| { echo "ERROR: juggler missing from $WIN_APP/omni.ja — Playwright can't drive it"; exit 1; }
echo "juggler GATE OK (win)"
mkdir -p out
( cd "$WIN_APP" && zip -qr "$GITHUB_WORKSPACE/out/${{ matrix.asset }}" . ) # firefox.exe at zip ROOT
ls -la out/
# ── macOS: package .app, ad-hoc sign, verify relative-internal symlinks, --version gate, tar
- name: Package + validate (macOS)
if: matrix.family == 'mac'
run: |
set -e
./mach package
APP="$(find obj-rel/dist -maxdepth 2 -name '*.app' -type d | head -1)"
[ -n "$APP" ] || { echo "ERROR: no .app produced"; exit 1; }
echo "built app: $APP"
# JUGGLER GATE: the .app's omni.ja must carry juggler (else Playwright can't drive it)
python3 -c "import zipfile,sys,glob; jas=glob.glob('$APP/Contents/Resources/omni.ja')+glob.glob('$APP/Contents/Resources/browser/omni.ja'); sys.exit(0 if jas and any(any('juggler' in n.lower() for n in zipfile.ZipFile(j).namelist()) for j in jas) else 1)" \
|| { echo "ERROR: juggler missing from .app omni.ja — Playwright can't drive it"; exit 1; }
echo "juggler GATE OK (mac)"
codesign --force --deep --sign - --timestamp=none "$APP"
codesign --verify --deep --strict --verbose=2 "$APP"
echo "=== --version GATE ==="
"$APP/Contents/MacOS/firefox" --version
echo "=== critical files present ==="
for need in "Contents/MacOS/firefox" "Contents/Info.plist"; do
[ -e "$APP/$need" ] || { echo "ERROR: missing $need"; exit 1; }
done
echo "=== Info.plist well-formed + required keys (a malformed plist → Finder 'damaged') ==="
plutil -lint "$APP/Contents/Info.plist"
for key in CFBundleExecutable CFBundleIdentifier CFBundleShortVersionString; do
plutil -extract "$key" raw -o - "$APP/Contents/Info.plist" >/dev/null \
|| { echo "ERROR: Info.plist missing $key"; exit 1; }
done
EXEC="$(plutil -extract CFBundleExecutable raw -o - "$APP/Contents/Info.plist")"
[ -e "$APP/Contents/MacOS/$EXEC" ] \
|| { echo "ERROR: CFBundleExecutable '$EXEC' has no matching binary in Contents/MacOS"; exit 1; }
echo "=== verify NO absolute symlinks in the .app (relative-internal ones are fine) ==="
BAD="$(find "$APP" -type l -print0 | xargs -0 -I{} sh -c 't=$(readlink "{}"); case "$t" in /*) echo "{} -> $t";; esac')"
[ -z "$BAD" ] || { echo "ERROR: absolute symlinks in .app (break on user machines):"; echo "$BAD" | head -5; exit 1; }
echo "mac .app OK: critical files present, no absolute symlinks"
STABLE="$(dirname "$APP")/Firefox.app"
[ "$APP" = "$STABLE" ] || mv "$APP" "$STABLE"
mkdir -p out
tar -czf "out/${{ matrix.asset }}" -C "$(dirname "$STABLE")" Firefox.app # preserves internal symlinks
ls -la out/
- name: Upload build artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: asset-${{ matrix.leg }}
path: out/${{ matrix.asset }}
if-no-files-found: error
retention-days: 7
# DRIVE GATE — the firefox-8 catcher. A raw `firefox --screenshot` proves
# nothing about automation: a juggler-less binary renders fine and ships
# broken (firefox-8 did exactly that). So we DRIVE every binary the way users
# will: Playwright launches it over the juggler pipe, loads a real page, and
# round-trips JS. A binary missing/broken juggler throws TargetClosedError
# here and the release never publishes. Headless, NO screenshot → GPU-free,
# so it can't false-fail on the GPU-less hosted runners. Zero proxy / zero
# secrets → safe in public CI (the proxy realness gate stays local, by design).
# Each leg runs on its NATIVE runner so we test the real artifact, not a cross
# surrogate. Playwright is pinned to a version validated against this build's
# juggler; bump it in lockstep when the juggler is re-synced from upstream.
gate:
name: gate-${{ matrix.leg }}
needs: build
runs-on: ${{ matrix.runner }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
include:
# `extra: --full` adds the mouse/keyboard/canvas/navsurface interaction
# checks. Only on linux-x86_64 (historically the most reliable hosted
# runner): the interaction code is platform-identical JS (omni.ja), so
# one reliable full run catches a firefox-2-class regression for all
# platforms. The other legs run SMOKE (launch+http+UA+webdriver) — the
# firefox-8/juggler catcher — which is robust even on the flaky
# windows-latest runner. See scripts/ci_drive_gate.py.
- leg: linux-x86_64
runner: ubuntu-24.04
kind: linux
asset: firefox-150.0.1-stealth-linux-x86_64.tar.gz
extra: '--full'
- leg: linux-arm64
runner: ubuntu-24.04-arm
kind: linux
asset: firefox-150.0.1-stealth-linux-arm64.tar.gz
extra: ''
- leg: win-x86_64
runner: windows-latest
kind: win
asset: firefox-150.0.1-stealth-win-x86_64.zip
extra: ''
- leg: macos-arm64
runner: macos-15
kind: mac
asset: firefox-150.0.1-stealth-macos-arm64.tar.gz
extra: ''
- leg: macos-x86_64
runner: macos-15-intel
kind: mac
asset: firefox-150.0.1-stealth-macos-x86_64.tar.gz
extra: ''
steps:
- name: Checkout wrapper (for scripts/ci_drive_gate.py)
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- name: Download asset
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: asset-${{ matrix.leg }}
path: art
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install Playwright driver (no bundled browser — we override executable_path)
# Pin from a SINGLE source (scripts/playwright_pin.txt) so release.yml and
# verify-assets.yml can't drift to different versions. The drive gate then
# ENFORCES playwright↔juggler compatibility: an incompatible pin fails the
# launch/drive (TargetClosedError / protocol error) and nothing publishes.
# Bump the pin file in lockstep when the juggler is re-synced from upstream.
shell: bash
run: python -m pip install --quiet "playwright==$(cat scripts/playwright_pin.txt)"
- name: Linux system deps for headless firefox
if: matrix.kind == 'linux'
run: sudo "$(which python)" -m playwright install-deps firefox
- name: Extract + locate firefox binary
shell: bash
run: |
set -e
mkdir -p ff
A="art/${{ matrix.asset }}"
case "${{ matrix.kind }}" in
win) python -c "import zipfile; zipfile.ZipFile('$A').extractall('ff')"; EXE="ff/firefox.exe";;
linux) tar xzf "$A" -C ff; EXE="ff/firefox";;
mac) tar xzf "$A" -C ff; EXE="ff/Firefox.app/Contents/MacOS/firefox";;
esac
[ -e "$EXE" ] || { echo "ERROR: firefox binary not found at $EXE"; exit 1; }
chmod +x "$EXE" 2>/dev/null || true
echo "FF_EXE=$EXE" >> "$GITHUB_ENV"
echo "located: $EXE"
- name: DRIVE GATE — Playwright launch via juggler + real page (+ interaction on --full)
shell: bash
run: python scripts/ci_drive_gate.py "$FF_EXE" ${{ matrix.extra }}
# CLOAK + WEBGL-MASKING GUARDS — run the wrapper's e2e cloak/gamma checks
# against THIS leg's freshly-built artifact, on its native runner. The
# wrapper's headless=True is headed+hidden (cloak on Win/macOS, its own
# Xvfb on Linux), so software-GL rendering works on the GPU-less hosts.
# test_cloak asserts the window is hidden (Windows DWMWA_CLOAKED / macOS
# CGWindowAlpha) AND still renders — the macOS leg is the only place the
# cocoa cloak patch gets RUN. The webgl guard catches a regression of the
# gamma readPixels noise back to the pixelscan-maskable ±1 spike form.
- name: Install pyobjc Quartz (macOS — to read the cloak window alpha)
if: matrix.kind == 'mac'
run: python -m pip install --quiet pyobjc-framework-Quartz
- name: Cloak + WebGL-masking guards (headed)
shell: bash
run: |
python -m pip install --quiet ".[dev]"
INVPW_BINARY_PATH="$FF_EXE" python -m pytest \
tests/test_cloak.py \
"tests/test_fingerprint_surface.py::test_webgl_readpixels_no_masking_signature" \
-m e2e -o addopts='' -q
publish:
name: publish-draft-release
needs: [build, gate]
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Download all build assets
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with: { pattern: asset-*, path: dl, merge-multiple: true }
- name: Assert all 5 target archives present (no silent partial release)
run: |
cd dl
EXPECTED="
firefox-150.0.1-stealth-linux-x86_64.tar.gz
firefox-150.0.1-stealth-linux-arm64.tar.gz
firefox-150.0.1-stealth-win-x86_64.zip
firefox-150.0.1-stealth-macos-arm64.tar.gz
firefox-150.0.1-stealth-macos-x86_64.tar.gz
"
for a in $EXPECTED; do
[ -s "$a" ] || { echo "ERROR: missing/empty release asset: $a (a build leg silently dropped out?)"; exit 1; }
done
echo "all 5 target archives present"
- name: Generate checksums.txt
run: |
cd dl; ls -la
# explicit glob — never include checksums.txt itself (the `*`-includes-itself trap)
sha256sum firefox-150.0.1-stealth-* > checksums.txt
echo "----- checksums.txt -----"; cat checksums.txt
- name: Resolve release tag
id: tag
run: |
TAG="${{ github.event.inputs.release_tag }}"
[ -z "$TAG" ] && TAG="${GITHUB_REF_NAME}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
# bare revision number for the release title: firefox-9 -> 9
echo "num=${TAG#firefox-}" >> "$GITHUB_OUTPUT"
echo "publishing DRAFT release for tag: $TAG"
- name: Create DRAFT release with all assets
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: invisible_firefox (150.0.1) rev ${{ steps.tag.outputs.num }}
draft: true
prerelease: false
fail_on_unmatched_files: true
files: |
dl/*.tar.gz
dl/*.zip
dl/checksums.txt
body: |
Patched Firefox 150.0.1 — built on GitHub Actions ($0, no mold).
Targets: linux-x86_64, linux-arm64, win-x86_64, macos-arm64, macos-x86_64.
DRAFT — do not publish until validate_release.py + realness gate pass on all archives.
macOS: ad-hoc signed (not notarized). After download run:
xattr -dr com.apple.quarantine Firefox.app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+135 -2
View File
@@ -7,15 +7,53 @@ on:
branches: [main]
workflow_dispatch:
permissions:
contents: read
# One run of this workflow per branch at a time. A newer push cancels the older
# in-flight run as a whole, cleanly, instead of leaving its queued jobs to be
# cancelled one by one - which left the run marked failed even though nothing
# had actually failed. Keyed by workflow + ref so tests and e2e never cancel
# each other; only an older run of THIS workflow on the same branch is replaced.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# `pip install -e ".[dev]"` below resolves `invisible-core==N.M.0` from the
# package index. The core is published BEFORE this package, so between the
# first push of this repo and that upload there is a window in which no
# install here can succeed. This gate answers "is it on the index?" and the
# unit job depends on the answer: during the window that job is SKIPPED (grey
# in the checks list, with the reason written into the run summary), never
# faked green; once the core is published it runs exactly as before. Full
# reasoning, including why `|| true`, `--no-deps` and a git fallback were all
# rejected, is in .github/workflows/core-on-index.yml.
core-on-index:
uses: ./.github/workflows/core-on-index.yml
unit:
name: pytest (${{ matrix.os }}, py${{ matrix.python }})
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ["3.11", "3.12"]
# Every version `requires-python = ">=3.11"` promises. Two of them were
# untested until 2026-08-01, and the user who opened issue #51 was on
# 3.14. test_marker_vocabulary.py compares this list to the floor.
python: ["3.11", "3.12", "3.13", "3.14"]
# Windows runners are the scarce, 2x-cost, slow-to-schedule ones, and a
# burst of pushes queues them for a long time. Run the FULL Python range
# on ubuntu (cheap, fast) and cover Windows on 3.12 only - this is a
# pure-Python package, the OS-specific surface is tiny. The python LIST
# above stays complete so test_marker_vocabulary still sees every version.
exclude:
- { os: windows-latest, python: "3.11" }
- { os: windows-latest, python: "3.13" }
- { os: windows-latest, python: "3.14" }
steps:
- uses: actions/checkout@v4
@@ -31,5 +69,100 @@ jobs:
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: arm the pre-push gates
# A fresh clone has no core.hooksPath, and the suite says so - the
# reminder moved into `invisible_core.testing` on 2026-07-28 and all
# three repos that existed then made the assertion (two now, since
# invisible_firefox was deleted on 2026-08-18), but only the core's CI
# had this step, so both consumers went red on it. Do here what a
# developer does once. It also means install_hooks.py is exercised on
# every runner instead of only on the one machine that ever ran it by
# hand.
run: python scripts/install_hooks.py
- name: undefined names and duplicate definitions
# F821 (undefined name) and F811 (redefinition) only. Not a style pass:
# these two are the rules that catch a name that cannot resolve, which
# `from __future__ import annotations` hides in an annotation and which
# a suite only finds if it happens to execute that line. Both bit on
# 2026-07-28 - a `throwaway_venv` used and imported nowhere took a
# user-install job red at RUNTIME, and six annotations named a type that
# was defined in no module at all.
#
# Zero violations in all three repos when this was added, so it is a
# gate rather than a cleanup backlog. Keep it that way.
run: |
python -m ruff check --select F821,F811,F601 --no-cache --output-format concise .
- name: Run pytest
run: pytest tests/ -v --tb=short
shell: bash
run: |
set -o pipefail # or tee would swallow pytest's exit code
pytest tests/ -v --tb=short -rs | tee tests-report.txt
# This repo has the largest suite of the three and was the only one with
# no floor. pytest's exit code cannot distinguish "everything passed"
# from "the marker expression deselected everything", and `addopts`
# already filters on two markers - one more, or a typo in one, silently
# turns 726 tests into 0 and reports success.
- name: Refuse a run in which the suite deselected itself
shell: bash
run: |
python - <<'PY'
import pathlib, re, sys
text = pathlib.Path("tests-report.txt").read_text(encoding="utf-8", errors="ignore")
m = re.search(r"(\d+) passed", text)
passed = int(m.group(1)) if m else 0
# FLOOR, not a target. It exists because a mis-wired selection runs
# almost nothing and still exits 0 - the exit code cannot see it.
#
# Was 600 until 2026-07-27, when 322 tests MOVED to invisible_core:
# they covered core modules and reached them through this package's
# four-line back-compat shims, so six real breaks in core code were
# surviving the core's own suite. Nothing shrank; the tests are in the
# package they test. This suite runs ~420 now.
#
# Keep it a little under the real count. It is a tripwire for "the
# selection collapsed", not an assertion about how many tests exist.
if passed < 380:
print(f"only {passed} test(s) ran (expected 380+) - the selection "
f"dropped most of the suite and the exit code cannot see it",
file=sys.stderr)
sys.exit(1)
print(f"{passed} tests ran")
PY
# UN SOLO CONTESTO PER LA BRANCH PROTECTION. Misurato 2026-08-13: la
# protezione di questo repo richiedeva `pytest (windows-latest, py3.11)`,
# che la matrice ESCLUDE esplicitamente qualche riga piu' su - un contesto
# che nessun job puo' produrre, quindi una protezione che non poteva mai
# essere soddisfatta. Con `enforce_admins` a false ogni push passava lo
# stesso e nessuno se ne accorgeva. Stessa forma nel core e nel manager.
#
# Un elenco di nomi di matrice va alla deriva ogni volta che la matrice
# cambia, ed e' esattamente cosi' che ci si e' arrivati. Questo job dipende
# dalla matrice intera e il suo nome non cambia mai.
#
# SKIPPED NON E' FAILED, ed e' la parte specifica di questo repo. `unit` e'
# saltato di proposito quando `core-on-index` dice che il pin non e' ancora
# sull'indice: durante quella finestra nessun install puo' riuscire, e il
# workflow ha scelto di SALTARE invece di fingere verde. Un gate che
# pretendesse `success` trasformerebbe quella scelta in un rosso e
# spingerebbe a togliere la protezione proprio nel giorno del rilascio.
# Quindi si rifiuta su `failure` e `cancelled`, non su `skipped`.
gate:
needs: [core-on-index, unit]
if: always()
runs-on: ubuntu-latest
steps:
- name: refuse unless nothing failed
run: |
echo "core-on-index: ${{ needs.core-on-index.result }}"
echo "unit: ${{ needs.unit.result }}"
case "${{ needs.unit.result }}" in
failure|cancelled) echo "the suite did not pass"; exit 1 ;;
esac
case "${{ needs.core-on-index.result }}" in
failure|cancelled) echo "the index check did not run"; exit 1 ;;
esac
echo "ok"
+183
View File
@@ -0,0 +1,183 @@
# ─────────────────────────────────────────────────────────────────────────────
# user-install.yml - can a person who has never seen this repo install it and
# drive a browser, on the two operating systems we claim to support?
#
# WHY THIS EXISTS, SEPARATELY FROM e2e.yml.
# e2e.yml installs the wrapper FROM THE CHECKOUT and then pins Playwright by
# hand. That is the right shape for testing a change: it exercises the code in
# the PR. It is the wrong shape for answering "does the published thing work",
# and the difference is not academic:
#
# * a checkout install never resolves `invisible-core==X.Y.Z` from the index,
# so the entire pin mechanism - the part most likely to break a release,
# and the reason a binary bump is now a three-package release - is outside
# what that job can see;
# * installing a blessed `playwright==<pin>` afterwards REPAIRS the venv. If
# the declared range resolves to a client the shipped Juggler cannot speak,
# that manual line turns the job green while every fresh install is broken.
# What a user gets is what pip resolves from the declaration, and that is
# what has to be under test.
#
# So this workflow installs nothing from the checkout except the test files. It
# takes `pip install invisible-playwright` from the index, in an empty venv, and
# runs it the way somebody's first script would.
#
# WHY IT MUST NOT BE MADE TOLERANT.
# There is a real window in which this cannot pass: between publishing the core
# and publishing the consumers. The tempting fixes - `|| true`, `--no-deps`, a
# git fallback - all produce a GREEN job that installed nothing, and that lie
# outlives the window by months. A red run during a publish is correct and
# readable. See core-on-index.yml, which makes the same argument at length.
#
# WHY BOTH OPERATING SYSTEMS.
# Windows is the primary target, and the two most recent defects were
# Windows-only by construction: firefox.exe is a launcher stub that spawns the
# real browser and exits, so a killed runner used to leave the tree behind, and
# the job-object fix for it has no counterpart on Linux. A Linux-only matrix
# would have seen neither.
# ─────────────────────────────────────────────────────────────────────────────
name: user-install
on:
workflow_dispatch:
inputs:
source:
description: "index (what users get) or git (an unpublished commit)"
required: false
default: index
type: choice
options: [index, git]
schedule:
# Weekly (Monday). The published artifacts do not change on their own, but
# everything around them does: pip resolves a new Playwright, GitHub moves a
# release asset, an index mirror lags. Those break users without any commit
# here, so a run triggered only by pushes would never see them. Weekly is
# enough to catch that drift without adding a Windows job to the queue daily.
- cron: "17 6 * * 1"
release:
types: [published]
permissions:
contents: read
concurrency:
group: user-install-${{ github.ref }}
cancel-in-progress: true
jobs:
install:
name: ${{ matrix.os }} - install from ${{ github.event.inputs.source || 'index' }} and launch
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false # one OS failing must not hide the other's result
matrix:
os: [ubuntu-24.04, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: '3.11' }
# Only what the TEST needs. The package under test is installed by the
# test itself, into a venv it creates, from the index - installing it
# here as well would put a second copy on the path and the assertions
# would be reading the wrong one.
- name: Test harness only
run: python -m pip install --upgrade pip pytest packaging
# PyPI does not serve a new version to pip the instant twine finishes, and
# this workflow runs on `release:` - which fires seconds after the upload.
# MEASURED 2026-07-28: invisible-firefox 0.2.6 was uploaded, the release was
# created about forty seconds later, and the pip install below still resolved
# 0.2.5. The job reported a forgotten publish that had happened two minutes
# earlier, which is the most expensive kind of red: it looks exactly like the
# real defect this workflow exists to catch.
#
# Bounded at five minutes, so a genuinely forgotten publish still fails. The
# PER-VERSION endpoint is the authority; the aggregate `info.version` lags it
# by minutes and has its own trap, so this asks for the exact URL.
#
# Only on `release:`. A scheduled or dispatched run is not racing anything,
# and a wait there would hide a real absence behind five minutes of polling.
- name: wait for the index to serve this version
if: github.event_name == 'release'
shell: bash
run: |
python - <<'PY'
import json, os, sys, time, tomllib, urllib.error, urllib.request
dist = tomllib.load(open("pyproject.toml", "rb"))["project"]["name"]
version = tomllib.load(open("pyproject.toml", "rb"))["project"]["version"]
url = f"https://pypi.org/pypi/{dist}/{version}/json"
deadline = time.monotonic() + 300
n = 0
while True:
n += 1
try:
with urllib.request.urlopen(url, timeout=30) as r:
if json.load(r).get("urls"):
print(f"::notice::{dist} {version} is on the index (attempt {n})")
sys.exit(0)
except urllib.error.HTTPError as e:
if e.code != 404:
print(f"::warning::index returned HTTP {e.code}; not waiting further")
sys.exit(0)
except OSError as e:
print(f"index unreachable ({e}); retrying")
if time.monotonic() >= deadline:
print(f"::warning::{dist} {version} still not on the index after 300s; "
f"running the checks anyway so a real absence is reported")
sys.exit(0)
time.sleep(10)
PY
- name: Linux runtime libraries for the browser
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libgtk-3-0 libdbus-glib-1-2 libasound2t64
- name: The user path, end to end
env:
# The release walk asks the GitHub API once per published version.
# Unauthenticated that is 60 calls an hour PER RUNNER IP, and the
# walk hit 403 on its eleventh call when measured by hand. A
# rate-limited walk SKIPS, and a skip is not a check.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INVPW_E2E_SOURCE: ${{ github.event.inputs.source || 'index' }}
shell: bash
run: |
set -o pipefail # or the tee below would swallow pytest's exit code
if [ "${{ runner.os }}" = "Linux" ]; then
xvfb-run -a python -m pytest tests/test_release_e2e.py tests/test_upgrade_e2e.py -m e2e \
-o addopts="" -v -rs | tee e2e-report.txt
else
python -m pytest tests/test_release_e2e.py tests/test_upgrade_e2e.py -m e2e \
-o addopts="" -v -rs | tee e2e-report.txt
fi
# A run whose tests all SKIPPED is not a pass, and it is the failure this
# suite is most exposed to: every test here is gated on `-m e2e` and
# several on a platform. `-rs` above prints the skips; this turns "nothing
# ran" into a refusal rather than a green tick.
- name: Refuse a run in which nothing actually ran
shell: bash
run: |
python - <<'PY'
import pathlib, re, sys
# pytest's own exit code cannot distinguish "all passed" from "all
# skipped", so the count is read back from the report it wrote.
report = pathlib.Path("e2e-report.txt")
if not report.is_file():
print("no report written; the step above did not run", file=sys.stderr)
sys.exit(1)
text = report.read_text(encoding="utf-8", errors="ignore")
m = re.search(r"(\d+) passed", text)
passed = int(m.group(1)) if m else 0
if passed < 6:
print(f"only {passed} test(s) actually ran (expected at least 6) - a suite that skipped "
f"itself is not a pass", file=sys.stderr)
sys.exit(1)
print(f"{passed} tests ran")
PY
-111
View File
@@ -1,111 +0,0 @@
# ─────────────────────────────────────────────────────────────────────────────
# verify-assets.yml — re-runnable DRIVE GATE for an EXISTING release's assets.
#
# release.yml drive-gates every binary it builds. This does the same drive test
# WITHOUT rebuilding: it downloads a release's already-published assets (works on
# DRAFT releases too via GITHUB_TOKEN) and drives each one on its native runner.
#
# Use it to:
# • drive-test a release that was built before the in-pipeline gate existed
# (e.g. firefox-9, built on the old release.yml), or
# • re-verify any shipped release on demand (regression check).
#
# Same single-source-of-truth drive logic as release.yml: scripts/ci_drive_gate.py.
# Headless, no screenshot → GPU-free. Zero proxy / zero secrets.
# ─────────────────────────────────────────────────────────────────────────────
name: verify-assets
on:
workflow_dispatch:
inputs:
release_tag:
description: 'release tag whose assets to drive-test (e.g. firefox-9)'
required: true
permissions:
# write (not read) is required: GitHub only exposes DRAFT releases to tokens
# with push access. With contents:read, `gh release download` on a draft tag
# 404s ("release not found"). This workflow only READS assets — the elevated
# scope is solely to make draft releases visible to GITHUB_TOKEN.
contents: write
jobs:
drive:
name: drive-${{ matrix.leg }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
include:
# --full (interaction) only on the reliable linux-x86_64 leg; others run
# the robust SMOKE drive. Same rationale as release.yml's gate.
- leg: linux-x86_64
runner: ubuntu-24.04
kind: linux
asset: firefox-150.0.1-stealth-linux-x86_64.tar.gz
extra: '--full'
- leg: linux-arm64
runner: ubuntu-24.04-arm
kind: linux
asset: firefox-150.0.1-stealth-linux-arm64.tar.gz
extra: ''
- leg: win-x86_64
runner: windows-latest
kind: win
asset: firefox-150.0.1-stealth-win-x86_64.zip
extra: ''
- leg: macos-arm64
runner: macos-15
kind: mac
asset: firefox-150.0.1-stealth-macos-arm64.tar.gz
extra: ''
- leg: macos-x86_64
runner: macos-15-intel
kind: mac
asset: firefox-150.0.1-stealth-macos-x86_64.tar.gz
extra: ''
steps:
- name: Checkout wrapper (for scripts/ci_drive_gate.py)
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- name: Download the release asset (draft releases included)
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
mkdir -p art
gh release download "${{ github.event.inputs.release_tag }}" \
--repo "${{ github.repository }}" \
--pattern "${{ matrix.asset }}" \
--dir art
ls -la art/
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install Playwright driver (no bundled browser — we override executable_path)
# Single-source pin (see release.yml); the drive gate enforces juggler compat.
shell: bash
run: python -m pip install --quiet "playwright==$(cat scripts/playwright_pin.txt)"
- name: Linux system deps for headless firefox
if: matrix.kind == 'linux'
run: sudo "$(which python)" -m playwright install-deps firefox
- name: Extract + locate firefox binary
shell: bash
run: |
set -e
mkdir -p ff
A="art/${{ matrix.asset }}"
case "${{ matrix.kind }}" in
win) python -c "import zipfile; zipfile.ZipFile('$A').extractall('ff')"; EXE="ff/firefox.exe";;
linux) tar xzf "$A" -C ff; EXE="ff/firefox";;
mac) tar xzf "$A" -C ff; EXE="ff/Firefox.app/Contents/MacOS/firefox";;
esac
[ -e "$EXE" ] || { echo "ERROR: firefox binary not found at $EXE"; exit 1; }
chmod +x "$EXE" 2>/dev/null || true
echo "FF_EXE=$EXE" >> "$GITHUB_ENV"
echo "located: $EXE"
- name: DRIVE GATE — Playwright launch via juggler + real page (+ interaction on --full)
shell: bash
run: python scripts/ci_drive_gate.py "$FF_EXE" ${{ matrix.extra }}
+59 -4
View File
@@ -5,21 +5,35 @@ name: webrtc-e2e
# Manual (workflow_dispatch) on purpose: it needs a firefox-N binary that
# carries the WebRTC fixes (synthetic srflx in genuine nICEr form + the
# default-route fallback behind a proxy). Run it after publishing such a
# binary — it is the release gate for "WebRTC looks real behind a proxy".
# binary - it is the release gate for "WebRTC looks real behind a proxy".
# Until that binary ships, test_not_blocked_behind_tcp_only_socks is EXPECTED
# to fail (the old binary is fully blocked behind a SOCKS proxy), which is the
# whole point of the gate.
#
# No smartproxy / credentials: the "behind a proxy" condition is faked by an
# No external proxy provider, no credentials: the "behind a proxy" condition is faked by an
# in-process TCP-only SOCKS5 server (refuses UDP ASSOCIATE) and the egress IP
# is injected as an RFC 5737 TEST-NET address. Fully self-contained.
on:
workflow_dispatch:
permissions:
contents: read
jobs:
# `pip install -e ".[dev]"` below resolves `invisible-core==N.M.0` from the
# package index, and the core is published BEFORE this package. This gate
# answers whether it is there yet; during that window the realness job is
# SKIPPED with the reason in the run summary rather than faked green, and
# once the core is up it runs unchanged. See
# .github/workflows/core-on-index.yml.
core-on-index:
uses: ./.github/workflows/core-on-index.yml
webrtc-e2e:
name: webrtc realness (ubuntu, py3.12)
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -39,9 +53,50 @@ jobs:
run: python -m invisible_playwright fetch
- name: Resolve binary path
run: echo "STEALTHFOX_E2E_BINARY=$(python -m invisible_playwright path)" >> "$GITHUB_ENV"
shell: bash
run: |
# NOT `echo "VAR=$(cmd)" >> $GITHUB_ENV`. echo exits 0 whatever the
# substitution did, so `set -e` never sees a failure and an EMPTY
# value lands in the environment. Both tests below then hit
# `pytest.skip("no patched binary")`, pytest exits 0, and the job is
# green having verified nothing - which is exactly what run #1 did.
set -euo pipefail
BIN="$(python -m invisible_playwright path)"
if [ -z "$BIN" ] || [ ! -e "$BIN" ]; then
echo "invisible_playwright path returned '$BIN', which is not a" >&2
echo "file. Refusing to run a suite that would skip itself green." >&2
exit 1
fi
echo "STEALTHFOX_E2E_BINARY=$BIN" >> "$GITHUB_ENV"
- name: Run WebRTC realness e2e (xvfb for the headless Firefox)
run: |
set -o pipefail
sudo apt-get update && sudo apt-get install -y xvfb
xvfb-run -a pytest tests/test_webrtc_realness.py -m e2e -o addopts="" -v -rs
xvfb-run -a pytest tests/test_webrtc_realness.py -m e2e -o addopts="" -v -rs | tee webrtc-report.txt
# Run #1 was GREEN with the headline assertion skipped: "1 passed, 1
# skipped", and the skipped one is the test this workflow's own header
# calls the point of the gate. pytest's exit code cannot tell that from a
# pass, and this file was the only one of four without a floor.
- name: Refuse a run whose main assertion did not execute
shell: bash
run: |
python - <<'PY'
import pathlib, re, sys
text = pathlib.Path("webrtc-report.txt").read_text(encoding="utf-8", errors="ignore")
passed = int((re.search(r"(\d+) passed", text) or [0, 0])[1] or 0)
skipped = int((re.search(r"(\d+) skipped", text) or [0, 0])[1] or 0)
if skipped:
print("these tests SKIPPED, so the gate verified less than it "
"claims:", file=sys.stderr)
for line in text.splitlines():
if line.startswith("SKIPPED"):
print(" " + line, file=sys.stderr)
if passed < 2 or skipped:
print(f"{passed} passed / {skipped} skipped - this gate exists for "
f"the synthetic-srflx assertion; a run that skips it is not "
f"a pass.", file=sys.stderr)
sys.exit(1)
print(f"{passed} tests ran, none skipped")
PY
+8
View File
@@ -6,3 +6,11 @@ build/
.pytest_cache/
.venv/
firefox-source/
# Third-party source trees kept on disk for on-demand compatibility audits.
# They are somebody else's code, with their own licence and their own .git, and
# they must never be committed into this repository: `git add -A` would either
# stage 3.9 MB of Apache-2.0 sources into an MIT repo or, worse, record a bare
# gitlink that nobody can clone. The sdist/wheel excludes only protect the
# published artifacts, not the repo, so the ignore has to live here too.
tests/playwright-upstream/
+304 -21
View File
@@ -4,16 +4,289 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.7.2] - 2026-08-18
### Added
- `timezone="auto"`: the browser timezone is auto-derived from the egress IP. By default (no explicit timezone) it ALWAYS resolves — from the proxy egress when a proxy is set, otherwise from the host's own public IP — so the zone can never disagree with the IP (the classic `timezone_mismatch` signal). An explicit `"Area/City"` is the only way to force a specific zone. On failure: with a proxy the launch raises (no silent host-TZ fallback behind a foreign proxy); without a proxy it falls back to the host TZ so a transient lookup can't break the launch.
- The egress IP is mapped to its IANA zone with an offline mmdb (`daijro/geoip-all-in-one`). It auto-updates against the upstream weekly rebuild: cached locally, re-checked after `GEOIP_REFRESH_DAYS` (7), older copies pruned, and a stale cache is reused when offline. `STEALTHFOX_GEOIP_MMDB` points at your own `.mmdb` to skip the download.
- `resolve_session_timezone(timezone, proxy)` and `ensure_geoip_mmdb()` re-exported at the package root (plus `GeoTimezoneError`) so integrations that own their launch can reproduce the resolution.
- `tests/test_geo.py` (37) + `tests/test_geoip_update.py` (freshness / auto-update / offline fallback) unit tests.
### Fixed
- Pins `invisible-core` 20.15.0, which carries a fix for a defect that lived in
17 published core versions. An `http://` or `https://` proxy handed to
`build_launch_plan` produced NO proxy preference at all: `configure_proxy`
returns a non-SOCKS endpoint to its caller, because only Playwright can answer
a proxy's 407, and that path launches the binary with `subprocess` and had
nowhere to put it. The browser then went out on the machine's own address
while the geo layer had already resolved timezone, locale and egress THROUGH
the proxy, so the session announced one country and connected from another.
**This wrapper was never affected and needs no change on your side.** It hands
the endpoint to Playwright, and that was measured: the same exit IP as curl
through the same proxy, in http and in socks5. The fix matters if you also use
`invisible_core.launch.build_launch_plan` directly.
### Removed
- The `browser launches` badge. The counter behind it was a release asset hosted
on a repository that was deleted on 2026-08-18, so the series is frozen on its
last real value and the renderer would have redrawn that number every morning.
A frozen figure presented as current is worse than no figure. The history is
untouched and the SVG on the `badges` branch stays, because already-published
PyPI pages are serving it.
## [0.7.1] - 2026-08-17
### Changed
- New runtime dependencies: `requests[socks]` (SOCKS egress lookup), `maxminddb` (mmdb reader), `tzdata` (IANA database for `zoneinfo`, which Windows lacks).
- Pins `invisible-core` 20.14.0, which seals firefox-20. The engine release is
the memory one: the same fingerprint at the same seed, the same detector
verdicts, less RAM and less CPU. The font faces stopped being copied twice on
their way into the shadow list, the bundle is opened by path instead of being
held in the heap, and the `.ttc` accounting now counts the faces we DECLARE
rather than every face the file happens to carry.
### Fixed
- This entry itself was missing until 2026-08-18. 0.7.1 shipped to the index on
2026-08-17 and the changelog stopped at 0.7.0, so for a day the released
version was undocumented. It was not caught by the release: the guard that
compares the index against this file, `test_the_changelog_documents_every_
version_it_claims_to_cover` in `tests/test_release_e2e.py`, is marked `e2e`
and the default selection deselects it. It fired on the first full e2e run
after the release, which is the run that happens for a reason unrelated to
releasing.
## [0.7.0] - 2026-08-11
### Changed
- Pins `invisible-core` 19.14.0, which seals firefox-19. The engine release
carries a `seal.json` asset for the first time, so the seal a client verifies
and the seal the build produced are the same bytes rather than two things
that agree.
- `session_kwargs` in the test bench no longer pins the proxy exit. It used a
literal session id, and the providers are sticky on it, so every realness
measurement this project made left through the same address: one distinct IP
in twenty-four hours, eleven events on it in one hour, and the detector had
classified it as a datacenter. The same binary on fresh exits scores 0, 3 and
0 where it scored 14. Consistency runs still pin one exit for their pair,
because that comparison is about our own determinism and a rotating exit puts
the network inside it.
### Fixed
- `scripts/ci_font_gate.py` asked a question whose answer could not mean
anything. It launched the engine raw, which since the generic-family map
became a declaration means launching it without one - and the engine does not
invent declarations. And it inferred "did this face load" from a line height
that we declare: it worked while the fallback measured 91 and the families 95,
and stopped the day the metrics became declared and the fallback landed on 95.
It now hands in the one declaration it needs and asserts which families SHARE
a face, measured from the ink box. Green on this build, on the previous
release, and on both platforms.
### Added
- Two e2e tests for failures the suite could not see: a session that dies under
heavy text shaping, and a frame reporting its parent's screen origin instead
of its own. Both validated by reintroducing the real defect in the engine and
rebuilding, not by reasoning about them.
## [0.6.1] - 2026-08-05
### Changed
- Pins `invisible-core` 18.13.0, which puts an upper bound in wall-clock time on the engine download. A `requests` timeout is per socket operation, so a connection delivering a byte every 59 seconds satisfied it forever and the transfer had no total limit; `INVISIBLE_DOWNLOAD_DEADLINE` (default 1800s) bounds it, and the refusal names the deadline, the elapsed time and the bytes received. Set it to 0 on a genuinely slow link.
- README: the Telegram invitation moved to the top and the status badges to the bottom.
## [0.6.0] - 2026-08-01
### Fixed
- `browser.new_page()` now gives the page the same context `browser.new_context()` does: the profile's viewport, screen, DPR, colour scheme, locale and timezone. It did not, because Playwright's `Browser.new_page` forwards to the IMPLEMENTATION object, whose own `new_page` calls `new_context` on itself, so a wrapper installed on the api object was never consulted. Measured in a real browser with the seed the e2e uses: `new_page` gave `innerWidth` 1280, Playwright's stock viewport, against a fingerprint reporting `screenWidth` 1920, while `new_context` gave 1906; a dark-pinned profile came back light on the same path. `new_page` is the call in this package's README, in the class docstring and in every example it ships, which is why this is a minor bump and not a patch.
- The engine-mismatch message told you to run `fetch --force`, three days after that flag was removed with four of the six subcommands. A test pinned the old string, so both were wrong together.
- Four tests marked `unit` drove `__enter__` with Playwright mocked and made two real network calls each, then sat out the lifetime guard's full 10s deadline waiting for a browser tree a mock never produces. 45.6s to 0.34s for that file. CI-only.
### Changed
- Requires `invisible-core==18.12.0`, which carries one prefs composition for all three entry points (`compose_session_prefs`), a `proxy=` argument on `get_default_stealth_prefs` that had no way to reach `configure_proxy` before, a proxy endpoint with no port refused rather than dropped silently, and a process scan that no longer asks psutil for the parent of every process on the machine.
- `build_prefs` delegates to that composition, so the three entry points that used to stack layers on top of `translate_profile_to_prefs` in their own order now agree, with the difference asserted as an exact set. What stays here is this path's delivery and its two decisions: the cloak, which only Windows and macOS need, and which generator draws the pointer path. `max_seconds_for` is applied here rather than passing `humanize` through, because `humanize=0` with the binary engine selected is a cap of nothing, not a request to disable motion, and passing it straight to the core would make it falsy and switch the generator off.
- Eight imports in `launcher.py` and `async_api.py` were unused and are gone. The ninth, `IANA_TO_POSIX_TZ` in `_session.py`, is not dead: the import IS the probe that turns an old core into a message about a version instead of a message about a symbol, so it keeps a `noqa` carrying the reason.
- `datetime.utcfromtimestamp` is replaced in `_recaptcha_seed.py`. It returns a naive datetime and has been deprecated since 3.12, which matters now that the matrix reaches 3.14.
- CI runs 3.11, 3.12, 3.13 and 3.14 on Ubuntu and Windows, every version `requires-python` promises; two of them had never run here. ruff selects F601 beside F821 and F811, because a dict literal with a repeated key silently keeps only the last one and Python does not warn.
- ruff is declared in the dev extra instead of being pip-installed unpinned on every run, so the tool that gates every push cannot change under us between two pushes. `pytest-mock` and `responses` were declared and used by no test in this package, and are dropped.
- Publishing is a workflow on a tag push using PyPI trusted publishing (OIDC, environment `pypi`), so there is no long-lived token on a machine or in a secret. The upload sits behind a gate that checks three things a person had to remember: the tag names the version being built, the `invisible-core==` pin is already on the index, and the suite passes, since a tag push does not trigger the ordinary test workflow. It needs a GitHub publisher registered on PyPI before its first run; until that exists the upload fails with `invalid-publisher`, which is the correct failure.
## [0.5.0] - 2026-08-01
### Changed
- The CLI is two commands, `fetch` and `version`. `path`, `clear-cache`, `doctor` and `fetch --force` are gone, and so is the tag argument. **Breaking for anybody scripting the four that were removed** - they fail loudly rather than being ignored, and a test asserts that. None of the behaviour is gone.
- `doctor` runs inside `fetch` now, on every run and before the download rather than after. That ordering is the point: a cached tree that no longer matches the seal is the case worth catching, and it is invisible to a "download if missing" that only looks at whether a file exists. It was the thing most worth doing and the thing least likely to be typed.
- `--force` is unnecessary once every run verifies: a tree is replaced because it does not match the seal, not because a flag was passed.
- `path` is the last line of `fetch`'s stdout, so `$(invisible-playwright fetch)` is the scripting form, and unlike `path` it guarantees the thing it names exists and matches. The mismatch report goes to stderr so it can never end up inside a captured path.
- `clear-cache` is deliberately NOT folded in. The cache root is shared with `invisible_firefox`, so pruning trees no seal points at would delete the other product's engine on a machine running both. `version` prints the location instead.
- The tag argument went with them: the seal decides which engine a build runs and `verify_engine` refuses anything else, so a tag on the command line could only ever name something that would then be rejected.
- The surface is asserted as an EXACT set, not a subset. A subset check passes while the CLI grows back one convenience at a time, which is how it reached six.
## [0.4.9] - 2026-08-01
### Changed
- Requires `invisible-core==18.11.0`. 18.10.0 classifies a 404 on the engine archive instead of raising a bare `HTTPError`, which is issue #51, and 18.11.0 removed the part of it that ran `pip install --upgrade` on the caller's environment: a library that installs things while it is running mutates an environment nobody asked it to touch, ignores whatever lockfile chose that version, and inside a container rewrites an image layer at runtime. What reaches a user of this package is that a 404 on the engine now says whether the release was retired on purpose, in which case no retry will find it and the message carries the upgrade command, or whether the tag is current and the fault is ours. Nothing in this package's behaviour changed.
### Fixed
- The README said the sampler draws "~400 fields". Measured against a real profile: 197 leaves on the most generous count, which treats every bundled font name as a field, and 155 prefs emitted. Corrected to ~200. `tests/test_readme_claims.py` now gates the engine version, the platform list, the download size, the documented subcommands in both directions, and every fenced Python example on the page - four claims that had nothing checking them.
- A publish was racing its own verification: the install e2e runs on `release:`, which fires seconds after the upload, and the index does not serve a new version to pip immediately, so the job reported a forgotten publish that had happened two minutes earlier. A bounded five-minute poll on the per-version endpoint, scoped to the release event. CI-only.
## [0.4.8] - 2026-07-28
### Changed
- Requires `invisible-core==18.9.0`, which carries a clearer engine refusal (it used to locate a missing juggler inside an `omni.ja` the tree does not have) and a publish gate that no longer reports a mistyped command with the same exit code as a broken gate. An exact pin means those reach a user only when this package's pin moves, so this release is what delivers them.
- CI runs ruff with F821 and F811 selected, those two only: they catch a name that cannot resolve, which is not a style question and not findable by running tests. Nothing here had ever run a linter, and there are zero violations once the three below are fixed.
### Fixed
- `Renderer` was used as an annotation six times in `_behaviour.py` and defined in no module in the repository. It survives only because `from __future__ import annotations` never evaluates an annotation, so the six were strings that looked like a type and a reader had no way to learn what the parameter accepts. It is a real alias now.
- `prof: Any` in `_motion.py`, with `Any` itself unimported. Importing it would have widened that module's deliberately tiny allowlist, which one of its own tests enforces, and there was no need: `prof` is the cumulative distance table `_profile_table` returns and `_profile_at` consumes, both annotated `list[float]` a few lines away.
- The install e2e imported the venv helpers from `invisible_core.testing`, which the runner does not have on purpose, so the job went red at collection having tested nothing. The helpers are local to those two files again, with the reason above them, and the core's suite now parses every file the user-install workflows name and refuses the import. CI-only.
- CI arms the hooks, because the suite asserts they are armed. The assertion moved into `invisible_core.testing` and all three repos started making it, but only the core's workflow ran `install_hooks.py`, so this repo went red on every push with a message about an unset config that reads like a developer's mistake rather than a missing CI step. CI-only.
## [0.4.7] - 2026-07-28
### Changed
- Requires `invisible-core==18.8.0`, which carries the work of the last two days: the prefs builder split into fourteen named steps with its output hash-identical across 400 profiles, the GeoIP fetch moved out of `download`, `invisible_core.pin` as a public module, and a publish gate whose index cross-check finally asks about the package it is gating.
- Nothing in this package's behaviour changed. The imports moved: it asks `invisible_core` for what that package exports instead of reaching into its private modules, and its own back-compat shims are for users again rather than for its own source.
### Fixed
- The suite could not tell a collapsed selection from a pass in one place and the install e2e imported the package it tests the install of in another; both are CI-only and neither reached a user.
## [0.4.6] - 2026-07-27
### Changed
- This package can no longer be published without a gate. A release used to be a bare `twine upload` of whatever happened to be in a directory - which is how 0.4.4 reached the index built from a tree that predated the fix it was meant to carry. The gate is `invisible_core.release`, one implementation for all three packages, and the pre-push hook runs it on a release tag. What makes it work is that `publish` builds and uploads *what it just built*, so a stale directory cannot be what ships.
- `PUBLISHED.json` records what actually reached the index, back-filled from the artifacts themselves.
- Requires `invisible-core==18.6.0`.
## [0.4.5] - 2026-07-27
### Fixed
- An environment holding an older `invisible-core` failed on the browser launch path with `ImportError: cannot import name 'IANA_TO_POSIX_TZ' from 'invisible_core'` - a symbol name, from a package whose version the reader did not choose. It now states which core version this build needs, keeps the original error inside the message for whoever is debugging, and ends with the command that fixes it. **0.4.4 has this bug and cannot be corrected in place; a PyPI filename is never re-uploaded. Use 0.4.5.**
## [0.4.4] - 2026-07-27
### Changed
- The process-lifetime machinery moved into `invisible-core`, shared with the profile manager. Both packages launch the same browser and both had the same leak; the manager had it a day longer because the fix lived here. `invisible_playwright._reaper` stays as a re-export, so nothing you import changes.
- The IANA-to-POSIX timezone table is the core's now. This package carried a byte-identical copy of all ten entries, including the Arizona row that exists because mapping it to `MST7MDT` made libc apply DST and an identification service deduce a Denver origin - and the core's own copy carried a comment admitting it had been copied from here. Two copies with a documented keep-in-sync obligation and nothing enforcing it.
### Fixed
- The lifetime guard counted an attempted job assignment as a successful one, so a process it had failed to adopt was never retried and the count it reported was a number of tries. Measured on the sibling package, that reported eight processes held while eight survived the kill. This package shipped the same accounting.
## [0.4.3] - 2026-07-27
### Fixed
- `async with InvisiblePlaywright(...)` no longer leaves browsers behind when the runner is killed. The lifetime guard added in 0.4.0 reached the sync entry point only, so every async user kept the entire leak while this file said it was closed. If you drive this package with `async with` on Windows, upgrading is the fix.
- The guard itself stopped adopting the process tree after the first process it found, so part of the tree stayed outside the kernel job even on the sync path. Found by killing the runner mid-session and counting the browsers still carrying that session's token: sync 0/0/0/0, async 2/0/0/2 - the same code on both, differing only in timing, which is what made an intermittent race look like a working feature. After the fix: ten sessions, zero survivors on both.
- `INVPW_TRUE_HEADLESS` now works on both entry points. It was read in the async class alone, so a documented environment variable applied or did not depending on whether you wrote `with` or `async with`.
### Changed
- The two entry points share their session logic instead of restating it: prefs, the launch environment and the IANA-to-POSIX timezone table live in one module both call. 80.6% of the async class was the sync class retyped, which is how a fix reaches one of them and a release note describes both.
- Requires `invisible-core==18.3.0`.
## [0.4.2] - 2026-07-26
### Changed
- The lifetime guard is a strategy object instead of a module of flags. `SessionToken` (a value object), `find_processes` (the only place psutil appears) and `LifetimeGuard` with a `JobObjectGuard` / `NullGuard` pair: `os.name` is tested in exactly one place, so no launcher code branches on the platform, and the Null implementation reports that it guarantees nothing rather than doing nothing while looking successful. Behaviour unchanged.
- The stroke planner is six named stages instead of one 203-line function, and the idle planner is a table of episodes instead of an if/elif chain with the weights written as bare literals in the branch conditions. Both verified byte-identical against recorded output, which caught two float-associativity regressions that no other test could see - `a * b * c` and `a * (b * c)` differ in the last bit, and that is enough to change a rounded pixel and every draw after it. A permanent fingerprint test now covers 576 cases and 16135 waypoints.
## [0.4.1] - 2026-07-26
### Changed
- Three long functions became named stages, with their output pinned before and after so the refactor could not change it in silence.
- The lifetime guard became a strategy rather than a module of flags.
- The forbidden-name scan no longer blocks a clone that has no word list.
## [0.4.0] - 2026-07-26
### Added
- Pointer movement is generated in this package, from the session seed, instead of by the engine. Existing code gets it with no edit: the six internal funnels every pointer action already goes through are wrapped, so a `page.click` written a year ago moves through the new generator. A plain `sync_playwright()` browser in the same process is untouched.
- Movement between actions: drift while reading, motion while the wheel turns, overshoot and correction, and movements that end on nothing. If every movement ends on something clickable, the set of endpoints is itself a signature however good each path is.
- `INVPW_CURSOR_ENGINE` selects the generator: `python` (default), `binary` (the previous behaviour) or `off`.
- The browser process tree is tied to this process's lifetime on Windows, so it cannot outlive a runner that was killed. Measured: eight survivors on the first attempt and twelve on the second before, zero after. `psutil` becomes a dependency for this - an optional reaper is absent exactly on the machines that need it, and silently. **This reached the SYNC entry point only. `async with` kept the whole leak through 0.4.2 - see 0.4.3.**
### Changed
- Install is now `pip install invisible-playwright`, from the index. The git URL is gone from the README, the CLI docs and the generated release notes. Nothing about the package changes for someone who was already installing it from git, except that pip can now see what it is holding.
- `invisible-core` is declared as an exact version specifier (`invisible-core== an exact version`) instead of a `git+https://...` direct reference. A direct reference carries no version, so there is nothing for `pip check` to compare and a broken environment reports clean; a real specifier is reported, exit 1, and a plain reinstall of this package repairs it. The cost is that a binary bump is now a release of every package that pins the core, which is deliberate.
- Requires `invisible-core>=18.2.0`, which bounds the timezone lookup as a step rather than only per request.
### Fixed
- `hover()` no longer fails intermittently on Windows. The approach now completes before the automation layer's hit-target check is installed, so the only event inside its window is that layer's own move, on target. Measured on a page whose target needs a scroll: 3 failures out of 3 before, 0 out of 3 after.
## [0.3.6] - 2026-07-25
### Fixed
- The browser tree now dies with this process even when the process is KILLED. An exception out of the `with` block was never the leak - `__exit__` runs and Playwright cleans up, measured over an interleaved A/B with zero survivors. The leak is the killed-runner path, where `__exit__` never executes at all: launch, kill the runner, and eight processes were still alive, twelve on the second attempt.
### Changed
- Declared as `invisible_playwright` on the index, pinning `invisible-core==18.1.0`.
## [0.3.5] - 2026-07-25
### Changed
- Playwright pin is back to `>=1.55,<=1.61.0`: the floor drop to `1.40` shipped in 0.3.4 is reverted. The conservative CI-tested floor (1.55) is kept together with the tested upper cap (1.61.0).
## [0.3.4] - 2026-07-24
### Changed
- Playwright floor lowered to `>=1.40,<=1.61.0`. The `1.55` floor was never a real compatibility bound - it was only the single minor that 0.3.1 had pinned. The `firefox-18` binary was smoke-tested (launch, `new_context`, navigate, evaluate, click) against 1.40, 1.45, 1.50 and 1.54 and passed on all four, so anyone on an older client keeps working; the upper cap stays at the tested 1.61.0. Reverted in 0.3.5.
## [0.3.3] - 2026-07-24
### Changed
- Playwright pin is now `>=1.55,<=1.61.0` (was `>=1.55,<1.62`). The open upper bound would let an untested version below 1.62 install and break a fresh setup the way 1.61 first did; the cap is now the exact version validated against this binary, 1.61.0. It moves forward on purpose, once a newer Playwright is tested against the binary.
- The expected Firefox version in the tests is derived from the constant instead of a hardcoded literal, so a binary bump no longer needs the test edited alongside it.
## [0.3.2] - 2026-07-24
### Changed
- Playwright pin moved to `>=1.55,<1.62` (was `>=1.55,<1.56`). The `firefox-18` binary rebases onto Firefox 151, which is what the latest Playwright (1.61) pairs with, so 1.61 now drives the binary natively - no more pinning to an older client. Both ends of the range were tested against the new binary (full browser suite on 1.61; drift-free protocol on 1.55). `scripts/playwright_pin.txt` -> 1.61.0.
- README badges are served as SVGs from the repo instead of a third-party badge service, so the header no longer depends on an external endpoint; the dynamic Firefox-version badge, which was the flaky one, is now static.
### Fixed
- The CI font gate checks that the whitelisted faces actually LOAD, not only that the family enumerates. Enumerating a font is not loading it, so the previous check could pass on a build that could name a family it could not render.
## [0.3.1] - 2026-07-13
### Fixed
- [#48](https://github.com/feder-cr/invisible_playwright/issues/48): Playwright 1.61 adds an `isMobile` field to the `Browser.setDefaultViewport` Juggler command that the FF150 binary does not accept, which kills the session. The range narrows from `>=1.40,<1.61` to the CI-tested 1.55.x (`>=1.55,<1.56`, single-sourced from `scripts/playwright_pin.txt`) so a fresh install always gets a compatible client. Widened again in 0.3.2, once `firefox-18` rebased onto Firefox 151.
### Changed
- The patched-Firefox source repo is now `feder-cr/firefox_antidetect_patch` (it was `feder-cr/invisible_firefox`, a name the profile manager took over). Release notes, CI references and the release URLs the download tests mock all point at the new name; the binaries themselves are unchanged.
- The wrapper no longer injects the font-list / system-UI environment variables at launch: the binary ships its own font bundle and is self-contained on that front. The integration tests were adapted and the font-sampling tests dropped.
### Added
- `scripts/ci_font_gate.py`: asserts the Windows font persona on every OS, so a Linux or macOS runner catches a font regression that would otherwise only show up on Windows.
## [0.3.0] - 2026-07-03
### Changed
- Pure config (seed -> fingerprint -> prefs, binary download, proxy, geo) is split out into a standalone `invisible-core` package with zero Playwright, so a profile manager can reuse it without pulling Playwright in. The wrapper depends on it and replaces the moved modules with full-alias shims: existing imports (public API, submodules, private names) and `isinstance` checks keep working unchanged. `tests/test_backcompat.py` locks that contract with 6 guards.
- `BINARY_VERSION` walks `firefox-7` -> `firefox-13` across this cycle: `firefox-8`, then `firefox-9` (`firefox-8` was found broken and is refused outright, not merely superseded), `firefox-10`, `firefox-11`, `firefox-12` (the cross-OS render-parity build) and `firefox-13` (geo-aware locale/Intl + the Windows font bundle + the audio gate).
- Playwright is capped at `<1.61` (`>=1.40,<1.61`) and the pin is single-sourced from `scripts/playwright_pin.txt` instead of being written in two places.
- WebGL personas: only the GPU buckets that survive the tampering checks are shipped, and the render-noise seed is decoupled from the persona seed.
- The dead `zoom.stealth.normalize_date_now` baseline pref is dropped.
- New runtime dependencies: `requests[socks]` (SOCKS egress lookup), `maxminddb` (mmdb reader), `tzdata` (IANA database for `zoneinfo`, which Windows lacks). After the split they arrive transitively through `invisible-core`.
### Added
- `timezone="auto"`: the browser timezone is auto-derived from the egress IP. By default (no explicit timezone) it ALWAYS resolves - from the proxy egress when a proxy is set, otherwise from the host's own public IP - so the zone can never disagree with the IP (the classic `timezone_mismatch` signal). An explicit `"Area/City"` is the only way to force a specific zone. On failure: with a proxy the launch raises (no silent host-TZ fallback behind a foreign proxy); without a proxy it falls back to the host TZ so a transient lookup can't break the launch.
- The egress IP is mapped to its IANA zone with an offline mmdb (`daijro/geoip-all-in-one`). It always tracks the upstream weekly rebuild: on every launch the current latest release tag is resolved from the `releases/latest/download` permalink (no GitHub API → no rate limit) and pulled only if newer than the cache, older copies pruned. Offline → the cached copy is reused; never a pinned tag (daijro prunes old releases, so a pin eventually 404s). `STEALTHFOX_GEOIP_MMDB` points at your own `.mmdb` to skip the download.
- `resolve_session_timezone(timezone, proxy)` and `ensure_geoip_mmdb()` re-exported at the package root (plus `GeoTimezoneError`) so integrations that own their launch can reproduce the resolution.
- `tests/test_geo.py` (37) + `tests/test_geoip_update.py` (freshness / auto-update / offline fallback) unit tests.
- Cross-OS render parity (needs `firefox-12`): the same font/canvas/WebGL fingerprint now renders consistently on Windows, Linux and macOS, so a Windows persona looks identical regardless of the host the binary runs on. Each whitelisted font renders a distinct canvas image (font-detection probes that dedup by rendered image keep every name), the standard Windows fonts (Calibri, Franklin Gothic, Gadugi, Javanese Text, Myanmar Text) are always present so the detected font set matches a real Windows install, and the per-seed render-noise leaves a solid-colour reference render byte-exact while still varying real fingerprint renders.
- GPU persona applied on every platform: Linux/macOS hosts now present a coherent Windows GPU (renderer + WebGL parameters) instead of the host's real adapter; pool re-rooted on a real-device GPU mix.
- `tests/test_canvas_render_stealth.py`, `tests/test_webgl_noise_active.py` and new `tests/test_sampler.py` cases: regression guards for per-font canvas distinctness, solid-readback purity under render-noise, and the always-present standard-font invariant.
- macOS support in the wrapper (x86_64 + arm64): the release pipeline builds five targets and the wrapper resolves the archive for the host it runs on.
- Headless is cloaked on Windows and macOS and runs under Xvfb on Linux, instead of the flagged headless mode; CI carries a cloak guard and a WebGL-masking guard. The cloak applies on the async path too.
- The e2e suite runs the real detectors offline (BotD, FingerprintJS, fpscanner, CreepJS, vendored under `tests/vendor/`) and a hermetic SOCKS5 auth + routing e2e, all on CI on every push. The 15 hand-rolled BotD imitations are dropped now that the real one runs.
- `fetch --force` on the CLI, to re-download an archive over a cached one.
### Fixed
- WebRTC behind a proxy ships the validated realness configuration, with CI guards: a fully blocked WebRTC is itself a tell, so the guard asserts the positive form and not merely the absence of a leak.
- The TLS ClientHello matches stock Firefox again: cipher `0xC009` was being offered and stock Firefox does not offer it.
- The humanize prefs were written under the wrong namespace.
- The font pool uses the real Windows 11 family name `franklin gothic medium`; the previous name does not exist on a real install.
## [0.2.0] - 2026-05-28
@@ -30,7 +303,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [0.1.8] - 2026-05-23
### Fixed
- [#20](https://github.com/feder-cr/invisible_playwright/issues/20): cross-origin iframes were unreachable from Playwright. `element_handle.content_frame()` returned `None`, `frame.evaluate()` threw cross-origin SOP errors, and `frame_locator(...).click()` timed out even with `force=True`. Root cause: FF150 defaults `fission.webContentIsolationStrategy=1` (`IsolateEverything`), which site-isolates every cross-origin iframe into a separate `webIsolated` content process even when `fission.autostart=False`. The parent's Juggler FrameTree then has a Frame placeholder with no docShell and no URL — every protocol op that needs to enter the iframe fails. Fix: pin `fission.webContentIsolationStrategy=0` (`IsolateNothing`) in the baseline prefs. The setting can be flipped back per session via `extra_prefs={"fission.webContentIsolationStrategy": 1}`.
- [#20](https://github.com/feder-cr/invisible_playwright/issues/20): cross-origin iframes were unreachable from Playwright. `element_handle.content_frame()` returned `None`, `frame.evaluate()` threw cross-origin SOP errors, and `frame_locator(...).click()` timed out even with `force=True`. Root cause: FF150 defaults `fission.webContentIsolationStrategy=1` (`IsolateEverything`), which site-isolates every cross-origin iframe into a separate `webIsolated` content process even when `fission.autostart=False`. The parent's Juggler FrameTree then has a Frame placeholder with no docShell and no URL - every protocol op that needs to enter the iframe fails. Fix: pin `fission.webContentIsolationStrategy=0` (`IsolateNothing`) in the baseline prefs. The setting can be flipped back per session via `extra_prefs={"fission.webContentIsolationStrategy": 1}`.
### Added
- `tests/test_cross_origin_iframe.py`: 4 unit + 5 e2e regression sentinels for cross-origin iframe interaction. The e2e layer runs entirely offline against two local HTTP servers on `127.0.0.1` (two ports = two SOP origins) and covers `page.frames` URL tracking, `content_frame()`, `frame.evaluate()`, `frame_locator(...).locator(...)`, and end-to-end `dispatch_event("click")` for plain, sandboxed and titled iframes. A future FF upgrade or fingerprint A/B that flips the pref back to `1` will fail the suite before shipping.
@@ -65,7 +338,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [0.1.4] - 2026-05-20
### Fixed
- [#13](https://github.com/feder-cr/invisible_playwright/issues/13): every page that threw an uncaught JS error (e.g. bunny.net) crashed the Playwright client with `TypeError: Cannot read properties of undefined (reading 'url')`. Root cause: upstream Playwright Juggler added a required `location` field to the `Page.uncaughtError` event in the 2026-05-07 roll ([microsoft/playwright@c8604ec](https://github.com/microsoft/playwright/commit/c8604ecd97)); our fork was carrying the pre-roll schema in every `firefox-N` build. Fix matches upstream — Runtime.js builds the `errorLocation`, PageAgent.js forwards it on both worker and runtime error paths, Protocol.js declares the schema field. Reporter: [@dionorgua](https://github.com/dionorgua).
- [#13](https://github.com/feder-cr/invisible_playwright/issues/13): every page that threw an uncaught JS error (e.g. bunny.net) crashed the Playwright client with `TypeError: Cannot read properties of undefined (reading 'url')`. Root cause: upstream Playwright Juggler added a required `location` field to the `Page.uncaughtError` event in the 2026-05-07 roll ([microsoft/playwright@c8604ec](https://github.com/microsoft/playwright/commit/c8604ecd97)); our fork was carrying the pre-roll schema in every `firefox-N` build. Fix matches upstream - Runtime.js builds the `errorLocation`, PageAgent.js forwards it on both worker and runtime error paths, Protocol.js declares the schema field. Reporter: [@dionorgua](https://github.com/dionorgua).
### Changed
- `BINARY_VERSION` bumped from `firefox-3` to `firefox-4`. JS-only change inside `chrome/juggler/`; `xul.dll` and `firefox.exe` are byte-identical to `firefox-3`.
@@ -73,23 +346,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [0.1.3] - 2026-05-19
### Changed
- `BINARY_VERSION` bumped from `firefox-2` to `firefox-3`. The new archives on both Windows and Linux are built from a clean clone of [feder-cr/invisible_firefox#stealth/150](https://github.com/feder-cr/invisible_firefox/tree/stealth/150) — the consolidated source-of-truth fork (renamed from `feder-cr/firefox`; the companion `feder-cr/firefox-stealth` patches repo was deleted, all patches now live as commits on top of `mozilla-firefox/firefox`).
- `BINARY_VERSION` bumped from `firefox-2` to `firefox-3`. The new archives on both Windows and Linux are built from a clean clone of [feder-cr/firefox_antidetect_patch#stealth/150](https://github.com/feder-cr/firefox_antidetect_patch/tree/stealth/150) - the consolidated source-of-truth fork (renamed from `feder-cr/firefox`; the companion `feder-cr/firefox-stealth` patches repo was deleted, all patches now live as commits on top of `mozilla-firefox/firefox`).
- The patched Firefox archive now ships the **proper C++ implementation** of `windowUtils.jugglerSendMouseEvent`, replacing the JS shim from 0.1.2.
### C++ fixes landed in this release
- **C1+C2**: `setDownloadInterceptor` IDL + cpp (re-landed for FF150).
- **C4**: 5 `nsIDocShell` stealth attributes (`fileInputInterceptionEnabled`, `overrideHasFocus`, `bypassCSPEnabled`, `forceActiveState`, `disallowBFCache`).
- **C5**: `LauncherProcessWin.cpp` + `nsWindowsWMain.cpp` juggler-pipe handle inheritance — without this, the Playwright pipe disconnects immediately on launch.
- **C6**: `juggler-navigation-started-renderer` / `-browser` observer notifications in `nsDocShell.cpp` and `CanonicalBrowsingContext.cpp` — without these, `Page.ready` never fires and `ctx.new_page()` hangs.
- **C5**: `LauncherProcessWin.cpp` + `nsWindowsWMain.cpp` juggler-pipe handle inheritance - without this, the Playwright pipe disconnects immediately on launch.
- **C6**: `juggler-navigation-started-renderer` / `-browser` observer notifications in `nsDocShell.cpp` and `CanonicalBrowsingContext.cpp` - without these, `Page.ready` never fires and `ctx.new_page()` hangs.
- **C7 (partial)**: storage stub for `nsIDocShell.languageOverride`. Workaround `InvisiblePlaywright(locale="")` recommended until full BC FIELD port lands.
### Verified
- Both archives built from same source: feder-cr/invisible_firefox commit `68906f1f9c55`.
- Both archives built from same source: feder-cr/firefox_antidetect_patch commit `68906f1f9c55`.
- Windows + Linux smoke suite green: launch, `ctx.new_page()`, `page.mouse.{move,down,up,click,wheel}`, `navigator.webdriver=false`, sannysoft 32/33 PASS.
- SHA256 published in `checksums.txt` on the `firefox-3` release.
### Notes
- This is the first release with a native Linux build of the patched binary (previous `firefox-3` draft mentioned shipping the Linux firefox-2 archive byte-for-byte; that no longer applies — Linux now has the full C++ patch series).
- This is the first release with a native Linux build of the patched binary (previous `firefox-3` draft mentioned shipping the Linux firefox-2 archive byte-for-byte; that no longer applies - Linux now has the full C++ patch series).
## [0.1.2] - 2026-05-18
@@ -103,8 +376,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [0.1.1] - 2026-05-18
### Fixed
- **Critical**: every `page.mouse.*`, `page.click(selector)`, `locator.click()`, `page.hover()`, `mouse.wheel()` failed on the patched Firefox 150 binary with `win.windowUtils.jugglerSendMouseEvent is not a function`. The Juggler JS was porting calls to a Playwright-specific C++ method that was never landed in the FF146→FF150 port; replaced with the Mozilla chrome-scope `win.synthesizeMouseEvent` helper which is present in FF150. Six call sites patched across `juggler/protocol/PageHandler.js` and `juggler/content/PageAgent.js`. Reporter: [@trob9](https://github.com/trob9) — [#9](https://github.com/feder-cr/invisible_playwright/issues/9).
- `_linkedBrowser.scrollRectIntoViewIfNeeded()` is now guarded at both call sites in `PageHandler.js` (`dispatchMouseEvent` and `dispatchWheelEvent`) — the method is not present on the shipped FF150 `<browser>` element, so the unguarded call threw before the mouse event was dispatched.
- **Critical**: every `page.mouse.*`, `page.click(selector)`, `locator.click()`, `page.hover()`, `mouse.wheel()` failed on the patched Firefox 150 binary with `win.windowUtils.jugglerSendMouseEvent is not a function`. The Juggler JS was porting calls to a Playwright-specific C++ method that was never landed in the FF146→FF150 port; replaced with the Mozilla chrome-scope `win.synthesizeMouseEvent` helper which is present in FF150. Six call sites patched across `juggler/protocol/PageHandler.js` and `juggler/content/PageAgent.js`. Reporter: [@trob9](https://github.com/trob9) - [#9](https://github.com/feder-cr/invisible_playwright/issues/9).
- `_linkedBrowser.scrollRectIntoViewIfNeeded()` is now guarded at both call sites in `PageHandler.js` (`dispatchMouseEvent` and `dispatchWheelEvent`) - the method is not present on the shipped FF150 `<browser>` element, so the unguarded call threw before the mouse event was dispatched.
### Added
- `tests/test_mouse.py`: 12-case regression suite covering every patched code path (mouse.move/click/dblclick/right-click, modifiers, locator.click/hover, wheel, manual mousedown+up, off-viewport move, humanize intermediate moves, scroll-and-click on offscreen element). Test cases inspired by `microsoft/playwright-python/tests/async/test_click.py`.
@@ -112,14 +385,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
### Notes
- The Stealthfox humanize Bezier expansion continues to fire intermediate `mousemove` events; the swap to `synthesizeMouseEvent` does not change the human-trajectory behavior (verified by test).
- The reCAPTCHA v3 score (0.90) and FingerprintPro / CreepJS results documented in the README are unaffected — `synthesizeMouseEvent` is a legitimate Mozilla helper that does not increase the anti-detect surface.
- The reCAPTCHA v3 score (0.90) and FingerprintPro / CreepJS results documented in the README are unaffected - `synthesizeMouseEvent` is a legitimate Mozilla helper that does not increase the anti-detect surface.
- A binary refresh of the patched Firefox archive on GitHub Releases is required for users to receive this fix (the Juggler JS is shipped inside the archive). The `BINARY_VERSION` will be bumped to `firefox-2` in that release.
## [0.1.0] - 2026-05-13
### Added
- Initial public release.
- `InvisiblePlaywright` sync and async context managers — drop-in replacement for `playwright.sync_api.Browser` / `async_api.Browser`.
- `InvisiblePlaywright` sync and async context managers - drop-in replacement for `playwright.sync_api.Browser` / `async_api.Browser`.
- StealthFox humanize hook: Bezier-curve mouse trajectories enabled by default.
- `_fpforge` Bayesian fingerprint sampler with ~400 fields per session.
- CLI: `invisible-playwright fetch | path | version | clear-cache`.
@@ -127,6 +400,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- SOCKS5 / SOCKS4 / HTTP / HTTPS proxy support with auth.
- Linux x86_64 and Windows x86_64 binary support.
[Unreleased]: https://github.com/feder-cr/invisible_playwright/compare/v0.1.1...HEAD
[0.1.1]: https://github.com/feder-cr/invisible_playwright/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.1.0
[0.4.3]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.3
> Le due voci piu' vecchie puntano a COMMIT e non a tag: 0.1.0 e 0.1.1
> precedono l'arrivo su PyPI (l'indice parte da 0.3.5) e non hanno mai
> avuto un tag. Crearne uno oggi non e' innocuo: `publish.yml` si innesca
> su `v*`, e per una versione che l'indice non serve `already-published`
> non corto-circuita, quindi un tag nuovo puo' far partire un tentativo di
> pubblicazione. Il commit e' la stessa informazione senza quel rischio.
[0.1.1]: https://github.com/feder-cr/invisible_playwright/compare/7a983e99c53fa1ec1a443651a4dd9de42258dc61...589c848e07a67c459969a2ddfb79851f48b10eff
[0.1.0]: https://github.com/feder-cr/invisible_playwright/commit/7a983e99c53fa1ec1a443651a4dd9de42258dc61
[0.4.4]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.4
[0.4.5]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.5
[0.4.6]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.6
+10 -7
View File
@@ -6,8 +6,8 @@ Thanks for your interest in improving this project. Contributions are welcome vi
- **Bug?** Open a [bug report](https://github.com/feder-cr/invisible_playwright/issues/new?template=bug_report.yml).
- **Idea?** Open a [feature request](https://github.com/feder-cr/invisible_playwright/issues/new?template=feature_request.yml).
- **Security issue?** Do **not** open a public issue — see [SECURITY.md](SECURITY.md).
- **The C++ patches** live in the companion repo [feder-cr/invisible_firefox](https://github.com/feder-cr/invisible_firefox) (branch `stealth/150`). Bugs in fingerprint spoofing usually belong there.
- **Security issue?** Do **not** open a public issue - see [SECURITY.md](SECURITY.md).
- **The C++ patches** live in the companion repo [feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch) (branch `stealth/150`). Bugs in fingerprint spoofing usually belong there.
## Scope
@@ -18,7 +18,7 @@ This repository ships the **Python wrapper** (`invisible_playwright`) around a p
- Binary download/caching, CLI, proxy plumbing
- Tests, docs, examples, packaging
Out of scope (belongs in `invisible_firefox`):
Out of scope (belongs in `firefox_antidetect_patch`):
- Changes to the Firefox C++ source
- New preferences exposed by the patched binary
@@ -26,6 +26,9 @@ Out of scope (belongs in `invisible_firefox`):
## Development setup
To *use* the package you do not need any of this: `pip install invisible-playwright`.
The steps below are for working on the code.
```bash
git clone https://github.com/feder-cr/invisible_playwright.git
cd invisible_playwright
@@ -40,7 +43,7 @@ Requires Python 3.11+ and one of: Windows x86_64, Linux x86_64.
## Running tests
```bash
pytest # unit + integration (default — fast)
pytest # unit + integration (default - fast)
pytest -m e2e # end-to-end, requires the patched binary
pytest -m slow # wheel-build regression tests
```
@@ -50,7 +53,7 @@ Markers are defined in `pyproject.toml`. The default run excludes `slow` and `e2
## Pull requests
1. Fork and create a topic branch (`fix/...`, `feat/...`, `docs/...`).
2. Keep PRs focused — one logical change per PR.
2. Keep PRs focused - one logical change per PR.
3. Add or update tests for any behavior change.
4. Make sure the default `pytest` run is green.
5. Follow [Conventional Commits](https://www.conventionalcommits.org/) for commit messages (e.g. `fix(launcher): handle missing profile dir`).
@@ -63,9 +66,9 @@ CI must be green before merge.
Before opening, please:
- Search [existing issues](https://github.com/feder-cr/invisible_playwright/issues) — the bug may already be tracked.
- Search [existing issues](https://github.com/feder-cr/invisible_playwright/issues) - the bug may already be tracked.
- Reproduce on the **latest release** if possible.
- Confirm the issue is in the Python wrapper, not the patched Firefox itself. If a fingerprint is leaking or a detector flags the browser, open the issue at `feder-cr/invisible_firefox` instead.
- Confirm the issue is in the Python wrapper, not the patched Firefox itself. If a fingerprint is leaking or a detector flags the browser, open the issue at `feder-cr/firefox_antidetect_patch` instead.
Include:
+2463
View File
File diff suppressed because it is too large. Load diff
+114 -67
View File
@@ -1,61 +1,42 @@
# invisible_playwright
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-dark.png">
<img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-light.png" alt="invisible_playwright" width="720">
</picture>
<h3 align="center">Free antidetect browser stealth for Playwright: undetected Firefox fingerprint, headless or headed.<br>
Python web scraping and captcha bypass. Open source, and it passes every bot detection test.</h3>
</div>
[![tests](https://github.com/feder-cr/invisible_playwright/actions/workflows/tests.yml/badge.svg)](https://github.com/feder-cr/invisible_playwright/actions/workflows/tests.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![Firefox 150.0.1](https://img.shields.io/badge/firefox-150.0.1-orange.svg)](https://www.mozilla.org/firefox/)
[![GitHub release](https://img.shields.io/github/v/release/feder-cr/invisible_playwright.svg)](https://github.com/feder-cr/invisible_playwright/releases)
[![GitHub stars](https://img.shields.io/github/stars/feder-cr/invisible_playwright.svg?style=social)](https://github.com/feder-cr/invisible_playwright/stargazers)
[![browser launches](https://img.shields.io/github/downloads/feder-cr/invisible_firefox/usage-counter/total?label=browser%20launches&color=blue)](https://github.com/feder-cr/invisible_firefox/releases/tag/usage-counter)
![invisible_playwright - 5/5 detection suites passed](https://raw.githubusercontent.com/feder-cr/invisible_playwright/7a8693c6b4386e9a84dd93bedc479ca8654482e1/docs/screenshots/hero.gif)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-Federico%20Elia-0A66C2?logo=linkedin&logoColor=white)](https://it.linkedin.com/in/federico-elia-5199951b6)
## How it works
**Stealth Firefox that passes every bot detection test. Drop-in Playwright replacement, fingerprint patched at the C++ level, not a JavaScript shim.**
Anti-bots ask two questions, and reCAPTCHA, hCaptcha and Cloudflare Turnstile score the answers. invisible_playwright answers yes to both.
![invisible_playwright - 5/5 detection suites passed](docs/screenshots/hero.gif)
**1. Is this a real browser?** Yes. It is Firefox, patched at the C++ source level.
- The browser fingerprint is set inside the engine, not injected into the page: navigator, screen, GPU/WebGL, canvas, fonts, audio, WebRTC, timezone, network. Headless or headed, the same values either way.
- No JS shim, no override, no seam to read.
## Why it's powerful
**2. Is a real person using it?** Yes. The actions are humanized in the driver.
- Every click, hover and drag follows a natural mouse path with human timing, no teleporting cursor.
- Each input is byte-identical to a real mouse: real input source, pressure, trusted events.
**Most other anti-detect browsers patch Chromium at the JavaScript level** - they override `navigator`, `WebGLRenderingContext.getParameter`, canvas APIs, and so on via injected scripts. This has two fatal problems:
1. **JS patches are detectable.** Anti-bots enumerate native function `.toString()`, check descriptor configurability, compare property enumeration order, watch for prototype mutations. Every patch leaves a fingerprint of its own. CreepJS has an entire battery of "lies detectors" built around this.
2. **Chromium itself is now suspect.** Residential-proxy bot traffic is overwhelmingly Chromium-based, so detectors weight anything Chromium-shaped as risky by default. Chromium-based forks inherit Chrome's open-source layers (BoringSSL, Blink, V8, ANGLE) cleanly, but they still cannot fully match Chrome in practice: Chrome ships closed-source components on top (Widevine, proprietary codecs, Google Update / Safe Browsing endpoints) that flip detectable JS feature flags and network signals, and forks lag Chrome's release cadence by days to weeks, leaving telltale version-specific behaviours that detectors lock onto.
**invisible_playwright patches Firefox at the C++ level.** The spoofed values come back out through the normal Gecko paths - there is no JS shim, no override, no `Object.defineProperty`. **From the page's point of view, the browser is just telling the truth.** Anti-bot lie-detectors have nothing to latch onto.
invisible_playwright spoofs **all the layers that matter, together, coherently**: Navigator, screen, GPU/WebGL, Canvas, fonts, audio, WebRTC, timezone, DevTools detection, SOCKS5 auth, and the rest. See [feder-cr/invisible_firefox](https://github.com/feder-cr/invisible_firefox) for the full per-layer breakdown of which C++ files are patched and why.
Everything is driven by preferences - no hardcoded values in the binary. You change one pref, you change the spoofed value.
Driven by the standard Playwright API. Full breakdown: [feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch).
---
## How it compares
**CloakBrowser** ships a similar pitch for Chromium, but its binary is **closed source** (the source-level patches are not published, you only get the compiled output), and it still hits the Chromium reCAPTCHA ceiling. The commercial anti-detect browsers (**Multilogin**, **GoLogin**, AdsPower, Dolphin, Kameleo) are paid SaaS that overlay JS-layer spoofing on a patched Chromium. Managed profiles are nice but raw detection bypass sits below both Camoufox and us.
| | invisible_playwright | Camoufox | CloakBrowser | Multilogin |
|---|---|---|---|---|
| Engine | Firefox 150 | Firefox (~1 year old base) | Chromium | Chromium fork |
| Patch depth | C++ source | C++ source | C++ source | JS overrides |
| Maintenance | Active | Gap (~1 year) | Active | Active SaaS |
| Open source | ✅ MIT | ✅ MPL | ❌ Closed source | ❌ Closed source |
| `.toString()` clean | ✅ | ✅ | ✅ | ❌ Detectable shims |
| Canvas / WebGL / Audio | ✅ C++ | ⚠️ Drift vs current FF | ✅ C++ | ⚠️ JS override |
| SOCKS5 auth | ✅ Patched | ❌ | ⚠️ Playwright proxy | ⚠️ Varies |
| **reCAPTCHA v3 score** | **0.90** | ~0.3-0.5 | ~0.3-0.5 | ~0.3-0.6 |
| FP Pro - bot detected | ✅ Not detected | ❌ Detected | ❌ Detected | ❌ Detected |
| CreepJS lies | ✅ 0 | ❌ Multiple | ✅ 0 | ❌ Multiple |
| Cost | Free | Free | Free | From $99/mo |
## Still seeing captchas or anti-bot? It's the proxy.
Once the browser is handled it stops being the variable. If you are still getting challenged, the tell is no longer the browser, it is the IP you come from. Around 90% of proxies are public: anyone can rent the same address, so it is already known and sits on the blocked-IP lists sites check. A perfect browser on a known IP still loses.
---
## Install
```bash
pip install git+https://github.com/feder-cr/invisible_playwright.git
python -m invisible_playwright fetch # one-time ~100 MB download, SHA256-verified
pip install invisible-playwright
python -m invisible_playwright fetch # one-time ~238 MB download (~544 MB unpacked), sha256-verified
```
Supported platforms: **Windows x86_64**, **Linux x86_64 / arm64**, **macOS arm64 / x86_64**. On macOS the app is ad-hoc signed (not notarized): if Gatekeeper complains, clear the quarantine flag once with `xattr -dr com.apple.quarantine` on the cached `Firefox.app`.
@@ -74,7 +55,7 @@ Supported platforms: **Windows x86_64**, **Linux x86_64 / arm64**, **macOS arm64
+ with InvisiblePlaywright() as browser:
```
Every session gets a unique, coherent fingerprint drawn from real-world Firefox telemetry (GPU / audio / fonts / ~400 other fields) and Bezier-curve mouse motion baked into the browser itself.
Every session gets a distinct fingerprint (GPU, audio, fonts, screen, ~200 fields) and Bezier-curve mouse motion.
**Sync**
```python
@@ -98,19 +79,7 @@ async with InvisiblePlaywright(proxy={"server": "socks5://...", "username": "u",
The `browser` object is a `playwright.sync_api.Browser` / `playwright.async_api.Browser` - every Playwright method works as-is.
---
### Random fingerprint per session
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright() as browser:
page = browser.new_page()
page.goto("https://creepjs-api.web.app")
```
Every call samples a new coherent profile. Log the seed to reproduce interesting runs:
Log the seed to replay a run:
```python
sf = InvisiblePlaywright()
@@ -138,7 +107,7 @@ with InvisiblePlaywright(proxy=proxy) as browser:
...
```
Schemes supported: `socks5`, `socks4`, `http`, `https`. Auth works on all of them (SOCKS5 via patched `nsProtocolProxyService.cpp`, HTTP/HTTPS via Playwright). DNS is routed through the proxy by default, no local leak.
Schemes supported: `socks5`, `socks4`, `http`, `https`. DNS is routed through the proxy by default, no local leak.
### Timezone
@@ -150,7 +119,7 @@ The browser timezone follows `timezone=`:
with InvisiblePlaywright(proxy=proxy) as browser:
...
# explicit IANA zone always wins — the only way to force a specific zone
# explicit IANA zone always wins, the only way to force a specific zone
with InvisiblePlaywright(proxy=proxy, timezone="America/New_York") as browser:
...
```
@@ -179,24 +148,102 @@ Full list of pinnable keys, how pinning interacts with the Bayesian sampler, and
## CLI
The installed command is `invisible-playwright`, with a hyphen. `python -m
invisible_playwright` works identically and needs nothing on PATH.
```bash
invisible_playwright fetch # download the binary if missing
invisible_playwright fetch --force # re-download even if cached
invisible_playwright path # print the absolute path to the cached binary
invisible_playwright version # wrapper and binary versions
invisible_playwright clear-cache # remove all cached binaries
invisible-playwright fetch # download the engine if missing, check every cached
# one against the seal, print the path
invisible-playwright version # wrapper, core and engine versions, and where the
# engine is cached
```
## Documentation, guides and comparisons
All of it reads better, and is searchable, in
**[the wiki](https://github.com/feder-cr/invisible_playwright/wiki)**,
organised into four sections instead of one flat list:
- **[Documentation](docs/documentation.md)** -
installation, the two-line switch from plain Playwright, proxy/timezone
configuration, pinning specific fields, the CLI.
- **[Guides](docs/guides.md)** - how
detection actually works, in seven groups: browser identity, canvas/WebGL/fonts/
audio, network and WebRTC, the automation layer, AI agents, the detectors themselves
explained from source, and testing.
- **[Comparisons](docs/comparisons.md)** -
against Camoufox, Patchright, nodriver and playwright-stealth, and the case for
Firefox over Chromium generally.
- **[Integrations](docs/integrations/)** -
Scrapy, Crawlee, Robot Framework, CodeceptJS, test runners, Playwright MCP, and the
frameworks it does not fit, by name.
If you don't know where to start: [Three ways to make Playwright undetected](docs/playwright-stealth-levels.md)
is the map most other pages link back to, [Playwright detected as a bot on one site](docs/playwright-detected-as-bot.md)
is the troubleshooting order, and [navigator.webdriver is not the tell you think it is](docs/navigator-webdriver-explained.md)
explains the most famous property in this space and why patching it alone buys you
almost nothing.
- [crawl4ai stealth and custom browser engines](docs/crawl4ai-stealth-custom-browser.md) - browser_type accepts firefox but there is no executable_path; where the adapter seam is
- [Why headless browsers render different fonts](docs/headless-fonts-differ.md) - the three causes, the per-platform font sets, and why the fix is not installing more fonts
- [How to make Linux and macOS report real Windows fonts](docs/bundled-fonts-cross-platform.md) - one manifest, three font backends convinced not to ask the host, and the four seams still open
- [measureText and TextMetrics as a fingerprinting surface](docs/measuretext-textmetrics-fingerprinting.md) - ten-plus numbers from one call needing no permission prompt, and the two mistakes we made fixing it
- [What privacy.resistFingerprinting really does](docs/resist-fingerprinting.md) - and why this project sets it to false on purpose
- [The ChromeDriver cdc_ variable](docs/cdc-variable-explained.md) - why renaming it is not removing it, and what that generalises to
- [What bot.sannysoft.com actually checks](docs/sannysoft-explained.md) - row by row, and the canvas-in-iframe test nobody reads
- [How CreepJS decides you are lying](docs/creepjs-explained.md) - four detection techniques, and why blocking the probe is itself recorded
- [Firefox preferences that silently do nothing](docs/firefox-prefs-not-applying.md) - five reasons, starting with the one that cost us a real bug
- [What BotD actually detects](docs/botd-explained.md) - twenty detectors, and why most are not about bots at all
- [Why a FingerprintJS visitor ID changes](docs/fingerprintjs-visitor-id.md) - it is a hash of 41 components, so one moving moves all of it
## Related projects
invisible_playwright takes a different angle than the major Firefox-hardening projects but stands on their shoulders:
The open-source neighbours, and what each one is for.
- **[arkenfox/user.js](https://github.com/arkenfox/user.js)** - the canonical Firefox configuration for privacy/security hardening via prefs. Reading arkenfox is how you understand which `user.js` knobs matter; invisible_playwright goes further by patching the C++ source where prefs alone are insufficient (Canvas noise, WebGL parameter overrides, font whitelisting, WebRTC IP swap, DevTools detection bypass).
- **[LibreWolf](https://librewolf.net)** - a Firefox fork bundled with sensible privacy defaults. Same audience, different distribution model: LibreWolf ships a configured Firefox binary, invisible_playwright ships source patches + a wrapper for automation.
- **[Camoufox](https://github.com/daijro/camoufox)** - the most well-known open-source anti-detect Firefox project. We share design goals on the fingerprint-spoofing side; the implementation approach differs (Camoufox patches a wider surface and ships its own fingerprint database, while invisible_playwright sticks closer to vanilla and drives spoofing from a Bayesian sampler).
**On the Firefox side**
- **[Camoufox](https://github.com/daijro/camoufox)** - an anti-detect Firefox that also patches at the C++ level. It covers a wider surface and ships its own fingerprint database; this project derives a fingerprint from a seed with a Bayesian sampler, so one number reproduces one machine. [Full comparison](docs/vs-camoufox.md).
- **[LibreWolf](https://librewolf.net)** - a Firefox fork with privacy defaults. It ships a configured binary for people to browse with; this ships source patches plus an automation wrapper.
- **[arkenfox/user.js](https://github.com/arkenfox/user.js)** - Firefox hardening through preferences. Where a preference is enough, use it; this project patches C++ where one is not.
**On the Chromium side**
- **[Patchright](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright)** - a patched Playwright fork, so the stealth work lands in the driver rather than in the browser binary. [Full comparison](docs/vs-patchright.md).
- **[nodriver](https://github.com/ultrafunkamsterdam/nodriver)** - the successor to `undetected-chromedriver`, driving Chrome over CDP directly and removing the WebDriver-flavoured tells. [Full comparison](docs/vs-nodriver.md).
- **[playwright-stealth](https://github.com/Mattwmaster58/playwright_stealth)** - an init-script patch applied before the page loads. Its own maintainer calls it a proof-of-concept; [full comparison](docs/vs-playwright-stealth.md).
- **[puppeteer-extra-plugin-stealth](https://github.com/berstend/puppeteer-extra)** - the original of this init-script lineage, still widely recommended. Its repository's last substantive commit is from mid-2024; [what that means in practice](docs/puppeteer-extra-stealth-unmaintained.md).
- **[selenium-stealth](https://github.com/diprajpatra/selenium-stealth)** - the same approach on Selenium/CDP. Its repository's last commit is from December 2021; [what that means in practice](docs/selenium-stealth-unmaintained.md).
- **[pyppeteer](https://github.com/pyppeteer/pyppeteer)** - the unofficial Python port of Puppeteer. Its own README says it's unmaintained and points to `playwright-python` instead; [what that recommendation is actually about](docs/pyppeteer-unmaintained-playwright.md).
- **[rebrowser-patches](https://github.com/rebrowser/rebrowser-patches)** - fixes the `Runtime.enable` CDP leak on Chromium, independently converging on close to the same fix Patchright uses. [Full comparison](docs/vs-rebrowser-patches.md).
- **[fingerprint-suite](https://github.com/apify/fingerprint-suite)** - generates a coherent fingerprint with a Bayesian network, close to this project's own generation approach, then injects it into a Playwright or Puppeteer page on either Chromium or Firefox. [Full comparison](docs/vs-fingerprint-suite.md).
- **[playwright-with-fingerprints](https://github.com/bablosoft/playwright-with-fingerprints)** - injects fingerprint values sourced from a remote paid service, Windows-only, pinned to a specific Chromium build. [Full comparison](docs/vs-playwright-with-fingerprints.md).
Which of these fits depends on the layer your problem is at, and on whether you need Firefox or Chromium. [Three ways to make Playwright undetected](docs/playwright-stealth-levels.md) works through what each layer can and cannot reach, including what this one costs.
If you are picking between engines rather than tools, note that a large share of AI agent frameworks drive Chromium over CDP, which decides the question for you: [AI browser agents and stealth](docs/ai-browser-agents-stealth.md).
---
## License
MIT - see [LICENSE](LICENSE). The patched Firefox binary is distributed under the MPL-2.0 (Firefox upstream license). The C++ patches against mozilla-central that produce that binary are at [feder-cr/invisible_firefox](https://github.com/feder-cr/invisible_firefox).
MIT - see [LICENSE](https://github.com/feder-cr/invisible_playwright/blob/main/LICENSE). The patched Firefox binary is distributed under the MPL-2.0 (Firefox upstream license). The C++ patches against mozilla-central that produce that binary are at [feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch).
---
## Disclaimer
This project is for educational purposes only. It is provided as-is, with no warranties. I take no responsibility for how it is used. Use it at your own risk and in compliance with the laws of your jurisdiction.
---
<p align="center">
Built by <a href="https://it.linkedin.com/in/federico-elia-5199951b6">Federico Elia</a>
&nbsp;<a href="https://it.linkedin.com/in/federico-elia-5199951b6"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/linkedin.svg" alt="LinkedIn"></a>
</p>
<p align="center">
<a href="https://github.com/feder-cr/invisible_playwright/actions/workflows/tests.yml"><img src="https://github.com/feder-cr/invisible_playwright/actions/workflows/tests.yml/badge.svg" alt="tests"></a>
<a href="https://github.com/feder-cr/invisible_playwright/blob/main/LICENSE"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/license.svg" alt="License: MIT"></a>
<a href="https://www.python.org/downloads/"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/python.svg" alt="Python 3.11+"></a>
<a href="https://github.com/feder-cr/firefox_antidetect_patch/releases"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/firefox.svg" alt="Firefox 151.0"></a>
<a href="https://github.com/feder-cr/invisible_playwright/stargazers"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/badges/docs/badges/stars.svg" alt="GitHub stars"></a>
</p>
+22 -29
View File
@@ -1,8 +1,12 @@
# Security Policy
## Disclaimer
This is an educational project. It is provided as-is, with no warranties. The maintainers take no responsibility for how it is used. Use it at your own risk and in compliance with the laws of your jurisdiction.
## Supported versions
Only the latest release on `main` receives security fixes.
Only the latest release on `main` receives fixes.
| Version | Supported |
|---------|-----------|
@@ -11,44 +15,33 @@ Only the latest release on `main` receives security fixes.
## Reporting a vulnerability
**Please do not report security issues via public GitHub issues, discussions, or pull requests.**
Do not report security issues via public GitHub issues, discussions, or pull requests.
Use one of the following private channels:
Send a report to `federico.elia.majo@gmail.com` with subject prefix `[security][invisible_playwright]`.
1. **GitHub Private Vulnerability Reporting** (preferred): open an advisory at https://github.com/feder-cr/invisible_playwright/security/advisories/new
2. **Email**: `federico.elia.majo@gmail.com` with subject prefix `[security][invisible_playwright]`
Include:
Please include:
- A clear description of the issue and impact
- Steps to reproduce (minimal repro preferred)
- The version of `invisible_playwright` and OS where it was observed
- Whether you have a suggested fix
## What to expect
- Acknowledgement of your report within **7 days**
- An initial assessment and tracking issue (private) within **14 days**
- Coordinated disclosure: a fix and public advisory are released together; reporters are credited unless they prefer to remain anonymous
- What the issue is and what it affects
- Steps to reproduce
- Version of `invisible_playwright` and OS
- Fix suggestion if you have one
## Scope
In scope:
- The Python wrapper `invisible_playwright` (this repo)
- The binary download/verification flow (SHA256 pinning, fetch endpoints)
- The Python wrapper (this repo)
- The binary download and verification flow
- The CLI
Out of scope here (report to the relevant project):
Out of scope:
- Vulnerabilities in the patched Firefox C++ source — open a private report at [feder-cr/invisible_firefox](https://github.com/feder-cr/invisible_firefox/security/advisories/new)
- Vulnerabilities in upstream Firefox / mozilla-central — report to Mozilla per https://www.mozilla.org/security/
- Vulnerabilities in third-party dependencies (`playwright`, `requests`, etc.) — report to those projects directly
- Vulnerabilities in the patched Firefox source - report to [feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch/security/advisories/new)
- Upstream Firefox / mozilla-central - report to Mozilla directly
- Third-party dependencies - report to those projects
## Out of scope
Not security issues:
- Reports that the browser is detected by a specific anti-bot service — open a regular GitHub issue, this is a product-quality concern, not a security one
- Social engineering of maintainers
- Denial of service requiring physical access or local privileged access
Thank you for helping keep the project and its users safe.
- The browser being detected by an anti-bot service - open a regular issue
- Social engineering
- DoS requiring physical or local privileged access
+15
View File
@@ -0,0 +1,15 @@
---
title: "docs/ source folder"
description: "This folder is the Jekyll source for the published documentation site. Read it there, with search and proper navigation, not as raw files."
nav_exclude: true
search_exclude: true
sitemap: false
---
# docs/ source folder
This folder is the source the wiki is rendered from. Read it with search and
navigation in **[the wiki](https://github.com/feder-cr/invisible_playwright/wiki)**.
`index.md` is what the site root actually serves. This file exists so the folder
still shows something sensible when browsed directly on github.com.
+270
View File
@@ -0,0 +1,270 @@
---
title: "about:webrtc: read your real ICE candidates"
description: "Read your live ICE candidates in Firefox's built-in about:webrtc: tell a real LAN-IP leak from a masked .local host and a proxy-egress srflx line."
parent: "Network, Proxy and WebRTC"
grand_parent: "Guides"
nav_order: 17
---
# about:webrtc: read your real ICE candidates
A public leak site gives you a verdict and a couple of IP strings. Firefox ships a
page that gives you the raw material behind that verdict: every
[ICE candidate](https://datatracker.ietf.org/doc/html/rfc8445) the
browser gathered, its type, its address, its priority, and the timeline of when each
one arrived. It is `about:webrtc`, it is built in, it needs no extension, and it is
the first place to look after any change to a WebRTC or proxy setting.
This page is how to read it, what the three interesting candidate states look like
line by line, how to pair it with `about:config`, and how to reproduce the same read
from a Playwright script so a bad candidate fails a test instead of a real session.
## Why a leak site is not enough
A leak site aggregates. It runs the gathering for you, picks the addresses it thinks
matter, and prints something like "Local IP" and "Public IP" with a green or red
badge. That summary hides exactly the distinctions you need while debugging, because
three very different underlying states can round to the same badge:
- A host candidate carrying a raw `192.168.x.x` LAN address. This is a real leak, and
it is *worse* than a stock browser, which hides that address by default.
- A host candidate carrying an obfuscated `<uuid>.local` name. This is the correct
state, and it is what a stock Firefox produces.
- A server-reflexive (`srflx`) candidate whose address is your proxy egress, with a
plausible NAT port and a priority in the range a real candidate uses.
A "No Leak" badge can be produced by the second and third states working correctly,
and it can also be produced by WebRTC being suppressed to the point that nothing is
gathered at all, which is [its own detectable signal](webrtc-leak-proxy.md). The
badge does not tell you which. The candidate list does.
## Opening about:webrtc and reading a session
Type `about:webrtc` into the address bar. The page is empty until a peer connection
exists, so open a page that creates one first, then come back to it. Each connection
gets a collapsible block; expand it and the two things worth reading are:
- **ICE Stats / the candidate table.** Every gathered candidate with its type
(`host`, `srflx`, `relay`), its address, its port, its protocol and its priority.
- **The ICE gathering log / timeline.** Timestamped lines showing when gathering
started, when each candidate was added, and when it finished. A candidate that
arrives suspiciously early (time zero, no round trip) is as much a tell as a wrong
address, and the timeline is the only view that shows arrival time.
You are reading for three things: that a host candidate exists and is masked, that a
server-reflexive candidate exists and points at the exit you expect, and that the
timeline looks like a browser talking to a STUN server rather than fabricating an
answer instantly.
## The three states a leak site collapses into one
Three candidate states, plus a suppressed section that gathers nothing, all round to
the same one-word leak-site badge. The table below is how each reads in the candidate
list; the lines underneath show the exact shape of each one.
| State | Candidate line | Leak-site badge | Verdict |
|---|---|---|---|
| Leak | `typ host` with a raw `192.168.x.x` LAN address | "Local IP" / red warning | Real leak, worse than stock |
| Correct host | `typ host` with a `<uuid>.local` name | "No Leak", local IP shown as "-" | Shipped, correct |
| Correct srflx | `typ srflx` with your proxy egress address | contributes to "No Leak" | Correct exit |
| Suppressed | nothing gathered at all | "No Leak" | Detectable tell, a FAIL |
Here is what each state looks like as a candidate line, so you can recognise it on
sight in the table.
**Leak (worst case).** The host candidate carries the machine's real LAN address:
```text
candidate:0 1 UDP 2122252543 192.168.1.24 51894 typ host
```
If you see a private `192.168.x.x`, `10.x.x.x` or `172.16-31.x.x` address on a `typ
host` line, WebRTC is handing out your internal network address. A stock browser does
not do this; it masks it. Seeing it means a masking setting is off, and you are now
more identifiable than a default install.
**Correct host.** The same candidate with the address replaced by a per-session mDNS
name:
```text
candidate:0 1 UDP 2122252543 3f1c9a7e-....local 51894 typ host
```
The `.local` name is what a stock Firefox emits by default, and a leak site reads it
as "No Leak" with the local IP shown as "-". This is the shipped state here: the
patched engine keeps host-address obfuscation on, so the host line is a `.local` name
and never a raw LAN IP.
**Correct srflx.** The server-reflexive candidate carries your public exit and a NAT
port:
```text
candidate:1 1 UDP 1686052863 203.0.113.45 49731 typ srflx raddr 0.0.0.0 rport 0
```
Behind a proxy, that address must be the proxy egress, not your real public IP and not
a private address. The port should sit in the ephemeral NAT range and the priority
should look like a real `srflx` priority rather than a round, hand-picked number.
Getting the [priority and foundation right, not just the address](webrtc-ice-candidate-spoofing.md),
is what separates a candidate that survives inspection from one that only survives a
leak badge.
## Pairing it with about:config
`about:webrtc` shows you the result; `about:config` shows you the switches that
produced it. Open a second tab on `about:config` and filter on two prefixes.
- **`media.peerconnection.*`** are the standard Firefox WebRTC prefs. The one that
governs the host state above is `media.peerconnection.ice.obfuscate_host_addresses`:
`true` gives you the `.local` name, `false` gives you the raw LAN IP. If
`about:webrtc` shows a `192.168.x.x` host, this is the first pref to check.
- **`zoom.stealth.webrtc.*`** is where the product exposes its own WebRTC controls,
including the egress the synthetic `srflx` is built from and the IPv6 host
suppression. These are set per session by the launcher from the proxy you pass, so
in normal use you read them here to confirm the wrapper resolved the right exit,
rather than editing them by hand.
The workflow is: change one pref, reload the page that builds the connection, refresh
`about:webrtc`, and read the candidate that changed. One switch at a time keeps cause
and effect legible, which is the same discipline that makes a bisect a bisect.
## Driving the same session from Playwright
The manual read is for exploring. Once you know which candidate line matters, you want
it as an assertion that runs every session, and `InvisiblePlaywright` returns a real
Playwright `Browser`, so the same code that opens `about:webrtc` can also gather
candidates programmatically.
First, opening the built-in page under a seeded, proxied session so you can eyeball it:
```python
from invisible_playwright import InvisiblePlaywright
PROXY = {"server": "socks5://gate.example.com:1080", "username": "u", "password": "p"}
with InvisiblePlaywright(seed=42, proxy=PROXY) as browser:
page = browser.new_page()
# A peer connection has to exist before about:webrtc has anything to show.
page.goto("https://example.com")
page.evaluate("new RTCPeerConnection().createDataChannel('x')")
inspector = browser.new_page()
inspector.goto("about:webrtc")
print("Expand the session to read candidates + the gathering timeline")
inspector.wait_for_timeout(3000)
```
Then the same read as data, so a wrong candidate fails a check instead of a session.
This gathers the candidate strings the page itself would list and prints them:
```python
from invisible_playwright import InvisiblePlaywright
PROXY = {"server": "socks5://gate.example.com:1080", "username": "u", "password": "p"}
GATHER = """
async () => {
const pc = new RTCPeerConnection();
pc.createDataChannel("probe");
const lines = [];
pc.onicecandidate = (e) => { if (e.candidate) lines.push(e.candidate.candidate); };
await pc.setLocalDescription(await pc.createOffer());
await new Promise((r) => setTimeout(r, 3000));
pc.close();
return lines;
}
"""
with InvisiblePlaywright(seed=42, proxy=PROXY) as browser:
page = browser.new_page()
page.goto("https://example.com")
candidates = page.evaluate(GATHER)
host = [c for c in candidates if "typ host" in c]
srflx = [c for c in candidates if "typ srflx" in c]
for c in candidates:
print(c)
# Assert the positive shape, not the absence of a leak.
assert host and all(".local" in c for c in host), "host must be an mDNS .local name"
assert srflx, "a proxied session must still produce a server-reflexive candidate"
assert not any(
p in c for c in host for p in ("192.168.", "10.", "172.16.")
), "no raw LAN address on a host line"
```
Because the identity is seed-derived, `seed=42` gives the same session every run, so a
candidate that fails this on one run fails it on the next, and you can [replay the
exact browser that produced it](quickstart.md) instead of chasing a random draw.
## A before-and-after you can measure
The distinction is not theoretical. With host obfuscation off, a leak page reports the
host candidate as the real LAN address and shows the red "WebRTC exposes your Local IP"
warning; the same page on the shipped baseline reports "No Leak" with the local IP as
"-", because the host line is now a `<uuid>.local` name and the only routable address
on the page is the proxy egress on the `srflx` line. Same session, one pref, and the
difference is the whole point of reading candidates instead of badges.
Assert the presence of the right candidate, not the absence of a wrong one. A WebRTC
section that comes back empty passes every "no leak" test and is itself a signal, which
is the same false pass that a [verdict-based test hides and a field comparison
catches](how-to-test-bot-detection.md).
## Conclusion
`about:webrtc` turns WebRTC from a badge into a list you can read. It shows the host
candidate so you can confirm it is a `.local` name and not a raw LAN IP, the
server-reflexive candidate so you can confirm it is your proxy egress with a plausible
port and priority, and the gathering timeline so you can confirm the answers arrived
the way a browser produces them rather than instantly. Pair it with `about:config` to
see the switches behind each line, drive the same read from Playwright to make it a
test, and change one pref at a time so every difference has a cause.
## Short answers to the questions that lead here
**What is about:webrtc for?** It is Firefox's built-in inspector for live peer
connections: the full ICE candidate list, each candidate's type and address and
priority, and the gathering timeline. It shows the detail a leak site summarises away.
**Why is my host candidate a 192.168 address?** Host-address obfuscation is off. A
stock Firefox emits a `<uuid>.local` name instead, and a raw LAN address is a real
leak. Check `media.peerconnection.ice.obfuscate_host_addresses` in `about:config`.
**What should the srflx candidate show behind a proxy?** Your proxy egress address,
with a NAT-range port and a realistic priority. Not your real public IP, not a private
address, and not a suspiciously round priority value.
**A leak site says "No Leak" but I still get flagged. Why?** "No Leak" can mean the
candidates are correct, or it can mean WebRTC was suppressed and gathered nothing,
which is itself detectable. The candidate list tells you which; the badge does not.
**Can I read about:webrtc from Playwright?** You can navigate to it with `page.goto`,
and you can gather the same candidate strings programmatically with `page.evaluate`
over a real [`RTCPeerConnection`](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection),
which turns the manual read into an assertion.
**Why does an empty WebRTC section count as a failure?** Because a real browser behind
NAT always emits at least a host and a server-reflexive candidate. Emitting nothing is
not neutral; it is a shape no ordinary browser has, so assert presence, not absence.
## Sources
- Firefox's built-in `about:webrtc` and `about:config` pages, read directly rather
than through a third-party summary.
- This project's WebRTC release gates and their per-event diagnostics, including the
incident where a negative-only check passed a fully blocked WebRTC section behind a
proxy, and the host-obfuscation fix that moved the host line from a raw LAN IP to a
`.local` name.
**See also:** [what actually leaks through a proxy](webrtc-leak-proxy.md),
[the srflx fields beyond the address](webrtc-ice-candidate-spoofing.md), and
[everything that has to agree with your exit IP](timezone-proxy-mismatch.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. Every candidate line in
this page is one I have read off about:webrtc while chasing a leak that a badge missed.*
@@ -0,0 +1,233 @@
---
title: "Do accelerometer and gyroscope APIs leak on desktop?"
description: "Desktop Firefox doesn't leak sensor data. Why a spoofed desktop must never invent motion events, and how to verify the sensor surface matches your platform claim."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 32
---
# Do accelerometer and gyroscope APIs leak on desktop?
Short version: on a real desktop Firefox they do not leak, because there is
nothing to leak. The generic Sensor APIs that expose an accelerometer or a
gyroscope reading are a Chromium feature, and the older DeviceOrientation and
DeviceMotion events stay silent on a machine with no motion hardware. So the
interesting question is not "how do I hide my sensors" - it is "am I sure my
automated desktop is not inventing motion data a real desktop would never
produce". A desktop that emits accelerometer or gyroscope readings is a
mobile-or-fake tell, and it contradicts the platform string sitting right next
to it.
This page walks through what a genuine desktop exposes, why faking motion is a
consistency failure rather than a clever disguise, what the patched build
reports, and how to check the surface yourself.
## What desktop Firefox actually exposes
Desktop Firefox exposes almost nothing on this surface: the generic Sensor
API is absent entirely, and the older DeviceMotion/DeviceOrientation events
exist as properties but never fire without motion hardware. Those are the two
separate families of device-motion API, and they behave very differently
across engines.
The **generic Sensor APIs** - [`Accelerometer`](https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer),
[`Gyroscope`](https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope),
`LinearAccelerationSensor`, `AbsoluteOrientationSensor` and the rest of that
family - are implemented in Chromium and, at time of writing, not in Firefox at
all. On a real Firefox, `typeof Accelerometer` is `"undefined"`. A page that
tries `new Gyroscope()` gets a `ReferenceError`. This is not a stealth trick;
it is simply what the engine ships.
The **[DeviceOrientation and DeviceMotion](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent) events** - `window.ondeviceorientation`,
`window.ondevicemotion` - do exist as properties in Firefox, because they are
part of an older, more widely shipped spec. But existing as a property is not
the same as firing. On a desktop with no accelerometer and no gyroscope, you can
add a `devicemotion` listener and it will never be called. The event surface is
present; the data behind it is silent.
So a truthful desktop Firefox answers the sensor question three ways at once:
the generic Sensor constructors are absent, the motion event handlers exist but
never fire, and `DeviceMotionEvent.requestPermission` (the iOS gesture gate) is
also absent because it is a mobile Safari construct. All three of those agree
with each other and with a `navigator.platform` of `Win32`.
## Why a desktop that emits motion is a tell
The failure mode here is not "a detector reads your accelerometer". It is a
detector noticing that your accelerometer exists at all when your platform says
it should not.
Detection on this surface is a cross-check, the same shape as every other
consistency check. A page reads `navigator.platform`, `navigator.userAgent` and
`navigator.oscpu`, decides you are claiming a Windows desktop, and then asks a
question a Windows desktop has a known answer to: does `window.DeviceMotionEvent`
ever produce a non-null reading? A desktop says no. If yours says yes - if some
well-meaning spoof layer decided to synthesize plausible-looking motion so the
sensor "would not look dead" - you have just told the page you are a phone
wearing a desktop user agent, which is a contradiction no real device produces.
This is why the honest move is silence, not simulation. The instinct to fill
every surface with realistic data is exactly wrong here: on a desktop the
realistic data is no data. The values that have to agree are your platform, your
oscpu, your touch surface and your motion surface, and they agree by all
pointing at the same kind of machine. If you want the platform side of that
in depth, see
[keeping navigator.platform and oscpu consistent](navigator-platform-oscpu-consistency.md);
the closely related touch side, where a desktop must report zero touch points,
is in [maxTouchPoints and pointer type](navigator-maxtouchpoints-pointer.md).
The general rule, which shows up on every fingerprint surface: a suppressed or
absent signal is not automatically a red flag. It is a red flag only when it
disagrees with what you claim to be. A desktop with no motion sensor is
correct. A mobile user agent with no motion sensor is the tell.
## What the patched build reports
invisible_playwright is a real Firefox patched at the C++ level and driven by
stock Playwright. On the sensor surface its job is the easy kind: report exactly
what a real Windows Firefox reports, which is silence. The generic Sensor
constructors stay absent, the DeviceMotion and DeviceOrientation handlers exist
but never fire, and nothing invents a reading to fill the gap. Because the whole
identity is seed-derived, the platform string, the oscpu string, the touch
surface and this motion surface all come from one coherent machine rather than
from four independent guesses, so they agree by construction.
That is the point of the demonstration below. There is nothing to configure and
no sensor flag to set - the correct desktop behaviour is the default, and the
launch is the ordinary two lines.
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
report = page.evaluate("""() => {
const motionFired = [];
window.addEventListener('devicemotion', e => motionFired.push(e), { once: true });
return {
platform: navigator.platform,
hasAccelerometerCtor: typeof Accelerometer !== 'undefined',
hasGyroscopeCtor: typeof Gyroscope !== 'undefined',
hasDeviceMotionEvent: 'DeviceMotionEvent' in window,
hasRequestPermission:
typeof (window.DeviceMotionEvent || {}).requestPermission === 'function',
motionEventsSeen: motionFired.length,
};
}""")
print(report)
# platform: 'Win32'
# hasAccelerometerCtor: False <- generic Sensor API is Chromium-only
# hasGyroscopeCtor: False
# hasDeviceMotionEvent: True <- handler exists...
# hasRequestPermission: False <- iOS-only, correctly absent
# motionEventsSeen: 0 <- ...but never fires: no motion hardware
```
Pass the same `seed` and the surrounding identity comes back identical every
run, so if you are bisecting a block you are changing one thing at a time rather
than chasing a fresh random machine on each attempt.
## Verify it yourself against a stock browser
Do not take the output above on faith - the useful test is a diff, not a
verdict. Open the same probe in a stock desktop Firefox on the same machine and
compare field by field. The two should agree on every line: same absent
constructors, same present-but-silent event handlers, same zero motion events.
Anything that differs between the automated browser and the stock one, other
than the exit address, is a candidate worth explaining.
Then extend the same probe to the neighbouring surfaces that have to tell the
same story - platform, oscpu, `maxTouchpoints`, screen. A detector reads them
together, so you should too. The method for turning that comparison into
something trustworthy, including why one green run is not a pass and why an empty
result is a failure rather than a clean sheet, is in
[how to test bot detection without a false pass](how-to-test-bot-detection.md).
For the wider point that a missing signal counts as a signal, the
[screen-size and headless tells](screen-size-headless-tells.md) page covers the
same idea on a different surface.
## What this fixes and what it does not
Matching the sensor surface makes invisible_playwright look like a genuine
desktop Firefox on one more axis, and that is real: the fingerprint, the TLS
handshake and the driver layer read as an ordinary Firefox, which is why a
consistent identity passes most in-page detection. But the sensor surface is a
narrow win, and it is worth being blunt about the boundary.
Reporting the correct silence does nothing for the parts of a session that are
not browser properties at all. It does not clean your **IP reputation** - a
perfectly consistent desktop on a datacenter or already-flagged address still
loses on the address. It does not manage **per-account quotas or rate limits** -
those are counted server-side regardless of how real the browser looks. And it
does not shape your **behaviour or timing** - a pointer that teleports, a form
filled in eighty milliseconds, or an agent that pauses in a shape that looks
like model latency will be flagged no matter how honest the sensor readings are.
Those are yours to supply: a clean residential exit and human pacing. If your
fingerprint is clean and you are still blocked, that separation is the whole
subject of [why you can be blocked with a clean fingerprint](why-blocked-with-a-clean-fingerprint.md).
So the honest framing: device-sensor consistency is one correct answer among
many, it costs you nothing here because the default is already right, and it is
necessary but nowhere near sufficient on its own.
## Conclusion
Accelerometer and gyroscope do not leak on desktop Firefox because desktop
Firefox has nothing to report: the generic Sensor APIs are Chromium-only, and
the motion events exist as handlers that never fire. The mistake to avoid is
over-correction - synthesizing motion data so the surface "does not look dead"
turns a correct silence into a contradiction with your platform string. The
patched build reports the same silence a real Windows Firefox does, keeps it
coherent with platform, oscpu and the touch surface because they all derive from
one seed, and leaves the parts it cannot touch - address, quotas, behaviour -
clearly labelled as yours.
## Short answers to the questions that lead here
**Does desktop Firefox expose accelerometer or gyroscope data?** No. The generic
Sensor API constructors are Chromium-only and absent in Firefox, and the older
DeviceMotion and DeviceOrientation events stay silent with no motion hardware.
**Is a silent sensor surface a red flag?** Only if it disagrees with what you
claim. A desktop with no motion sensor is correct; a mobile user agent with no
motion sensor is the tell.
**Should I fake motion events to look more real on a desktop?** No. That is the
one thing that breaks it - a desktop emitting accelerometer or gyroscope
readings contradicts its own platform string.
**Do the DeviceMotion event handlers exist at all in Firefox?** Yes, the
`ondevicemotion` and `ondeviceorientation` properties are present, but they never
fire without hardware, so a listener is simply never called.
**Does invisible_playwright need a sensor flag set for this?** No. Reporting the
correct desktop silence is the default; there is nothing to configure.
**Does getting the sensor surface right mean I will not be detected?** No. It
helps with fingerprint consistency, not with IP reputation, account quotas, rate
limits, or behaviour and timing, which you still have to supply.
## Sources
- The generic Sensor APIs (`Accelerometer`, `Gyroscope` and family) as an
engine feature present in Chromium and not in Firefox, read from each engine's
own behaviour rather than from a summary.
- The DeviceOrientation and DeviceMotion event model, and its behaviour on
hardware with no motion sensor.
- This project's release gates, which compare the patched build's surfaces field
by field against a stock desktop Firefox on the same machine.
**See also:** [navigator.platform and oscpu consistency](navigator-platform-oscpu-consistency.md),
[maxTouchpoints and pointer type](navigator-maxtouchpoints-pointer.md), and
[why you can be blocked with a clean fingerprint](why-blocked-with-a-clean-fingerprint.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The sensor surface
is the easy kind of honest: the correct answer is to report nothing, and the only
way to fail is to invent data a real desktop would never send.*
+223
View File
@@ -0,0 +1,223 @@
---
title: "Accept-Language header vs navigator.languages"
description: "Accept-Language and navigator.languages must agree: one Firefox pref feeds both, so an injection-only spoof that moves one and not the other is a clear tell."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 21
---
# Accept-Language header vs navigator.languages
A real browser reports its preferred languages in two completely separate places. It
sends an `Accept-Language` header on every HTTP request, decided by the network stack
before any page runs. And it exposes `navigator.language` and `navigator.languages` to
JavaScript, read from the page after it loads. Two surfaces, two code paths, and a
detector that reads both expects them to tell the same story.
They do, in a stock browser, because both come from one setting. The interesting failure
is what happens when a stealth layer touches only one of them.
## One preference feeds both surfaces
In Firefox the language preference lives in a single about:config string,
`intl.accept_languages`, with a value like `en-US,en`. That one string is the source for
two different consumers:
- The **network stack** formats it into the `Accept-Language` request header, adding the
quality values (`en-US,en;q=0.5`) a browser normally attaches.
- The **JavaScript engine** parses the same string into the `navigator.languages` array
and its first element into `navigator.language`.
Because both read the same preference, they cannot disagree. Change the preference and
the header changes and the array changes, together, in the same load. There is no way,
inside a genuine browser, to make the header say one thing and the property say another,
because there is only one value and both surfaces quote it.
That single-source property is worth stating plainly, because it is exactly the invariant
a naive spoof breaks.
## Why an injection-only spoof splits the two
A large class of stealth tooling works by running JavaScript in the page before the
site's own code: it redefines `navigator.languages` with `Object.defineProperty`, or it
patches the getter. That reaches exactly one of the two surfaces. It can make
`navigator.languages` return `["en-US", "en"]` to any script that asks.
It never touches the header. The `Accept-Language` header was formatted and sent by the
network layer, which is compiled C++ and does not read the JavaScript you injected. So
the request that fetched the page carried whatever the underlying browser's real
preference was, while the property in the page now claims something else.
The split lines up field by field like this:
| Surface | Real browser | Injection-only spoof |
|---|---|---|
| `Accept-Language` header | formatted from the language preference | unchanged real value (sent by the network layer) |
| `navigator.languages` | parsed from the same preference | overridden in the page |
| Do the two agree? | yes, one shared source | no, they diverge |
A detector does not need to be clever to catch this. It reads the `Accept-Language` it
received on the request, reads `navigator.languages` from a script it served, and
compares the two strings. When the header says one language set and the property says
another, that contradiction is the tell. It is the same shape of mistake as
[running two spoofers that answer the same question differently](playwright-detected-as-bot.md):
one value moves, its twin does not, and the gap between them is louder than either value
alone.
The same reasoning extends to the request headers a browser sends about itself, which is
why [the Sec-Fetch and client-hint headers](client-hints-sec-fetch.md) have to line up
with the rest of the identity for the same structural reason: a header the page cannot
see is a header an injection cannot fix.
## How this project keeps header and property in agreement
Because the fingerprint is applied at the browser level rather than in the page, the
language is set through the same native preference a real profile uses, so both surfaces
read from it. There is nothing to inject into the page and nothing to keep in sync: the
header and the array are the same value formatted twice, by the browser, the way they
always are.
The code that drives it is stock Playwright. Switching a normal Playwright script over is
the launch line and nothing else:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
langs = page.evaluate("navigator.languages")
print("navigator.languages =", langs)
```
The `browser` returned is a real Playwright `Browser`, so every method you already use
works unchanged. The seed makes the whole identity reproducible: the same seed yields the
same language set, the same GPU, the same screen, run after run, which is what lets a
failure be replayed instead of guessed at.
## Prove they match, do not assume it
The point of this page is a check you can run rather than a claim to trust. Capture the
`Accept-Language` header the browser actually sent, read `navigator.languages` from the
loaded page, and compare the two directly. Use any endpoint that echoes request headers
back; the snippet below reads the header off the outgoing request instead, so it needs no
particular server:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
sent_header = {}
def capture(request):
if "accept-language" in request.headers:
sent_header["value"] = request.headers["accept-language"]
page.on("request", capture)
page.goto("https://example.com")
header = sent_header.get("value", "")
array = page.evaluate("navigator.languages")
print("Accept-Language header :", header)
print("navigator.languages :", array)
# The header's primary tag and the array's first entry must be the same language.
header_primary = header.split(",")[0].split(";")[0].strip()
assert header_primary == array[0], (header_primary, array[0])
print("header and property agree")
```
Follow the method from
[how to test whether your browser is detected](how-to-test-bot-detection.md): assert the
values are present and agree, rather than asserting nothing looks wrong. A property that
comes back empty, or a header your capture never saw, is a failure and not a pass. Run it
against a stock browser on the same machine too, and the header and array should match
there in exactly the same way.
## Match the language to the exit, the same way you match the timezone
Header and property agreeing with each other is necessary but not sufficient. Both of
them also have to agree with where the request appears to come from.
A session whose exit address resolves to one country while the browser advertises the
language of another is a contradiction of the same family as
[a timezone that does not match the proxy](timezone-proxy-mismatch.md). The two values
are individually plausible and jointly wrong, which is precisely what field-by-field
comparison catches and a single-value check does not. If you
[rotate through several exits](how-to-rotate-proxies-playwright.md), the language set is
one more field that should track the exit rather than staying pinned to whatever the host
machine happens to prefer. Pass the proxy at launch and let the identity be built to fit
it, rather than setting the language by hand and hoping it lines up:
```python
from invisible_playwright import InvisiblePlaywright
proxy = {"server": "socks5://gate.example.com:1080", "username": "u", "password": "p"}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com")
print("languages =", page.evaluate("navigator.languages"))
```
## Conclusion
The `Accept-Language` header and `navigator.languages` are read from one browser
preference, so in a genuine browser they cannot diverge. That is the whole reason the
pair is worth checking: a stealth layer that lives in the page can move the property and
never the header, and the gap it opens is a cleaner signal than any single value. Set the
language where the browser itself reads it, keep it consistent with the exit, and verify
by comparison rather than assumption.
## Short answers to the questions that lead here
**Do Accept-Language and navigator.languages have to match?** Yes. In a real browser both
are formatted from one preference, so a mismatch is a contradiction that only a spoof
produces.
**Why does setting navigator.languages in JavaScript not work?** Because it reaches only
the page-facing property. The `Accept-Language` header was already sent by the network
layer, which does not read your injected script, so the header still carries the old
value.
**How do I set the browser language in Playwright?** Let the fingerprint layer set the
native preference so both surfaces read from it, rather than overriding the property in
the page. Here the language comes with the seeded identity.
**Should the language match the proxy country?** It should be consistent with the exit,
the same way the timezone has to be. A language from one continent on an exit in another
is a mismatch a detector can pair up.
**How do I check the two agree?** Capture the `Accept-Language` header the browser sent,
read `navigator.languages` from the loaded page, and compare the primary language tag of
each. Do it against a stock browser as well.
**Does the q-value in the header matter?** It should be present. A real browser attaches
quality values like `;q=0.5`; a header that is a bare comma list with none is itself
slightly unusual.
## Sources
- Firefox's `intl.accept_languages` preference, which is the single value both the request
header and the `navigator.languages` array are formatted from.
- [MDN: `Navigator.languages`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages)
and [MDN: `navigator.language`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language),
the page-facing properties an injection redefines.
- [MDN: the `Accept-Language` request header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language),
including the quality (`q`) values a browser attaches, sent by the network stack before any page script runs.
- This project's own realness gates, which compare request headers against in-page
properties field by field rather than reading either in isolation.
**See also:** [when the timezone does not match the proxy](timezone-proxy-mismatch.md),
[when the TLS fingerprint and the user agent disagree](tls-fingerprint-user-agent-mismatch.md),
[the checklist for being detected on one site](playwright-detected-as-bot.md), and
[how to test whether your browser is detected](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The header and the array
come from one preference, which is exactly what an injection-only spoof gets wrong.*
+221
View File
@@ -0,0 +1,221 @@
---
title: "AI agent retry loops trip rate limits, not fingerprints"
description: "Why AI agent retry loops multiply requests into a volume signal that trips rate limits, and why throttling belongs in the agent loop, not the browser engine."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 17
---
# AI agent retry loops trip rate limits, not fingerprints
An agent that gets a browser to look like a real person will still get blocked if it
asks for a page thirty times in ten seconds. That block has nothing to do with the
fingerprint. It is a counter.
This page is about the failure mode that a perfect disguise does not touch: an agent
retries and re-plans on failure, every retry is another request, and a stack of retries
per second is a volume and behaviour signal that trips rate limits and quotas long
before any fingerprint check runs. The fix does not live in the browser. It lives in
the loop that drives it.
## Why an agent makes more traffic than a scraper
A hand-written scraper visits a known list of URLs once. An agent does not. It observes
a page, decides a next action, acts, and when the action fails it re-plans and tries
again. That control loop is the whole point of an agent, and it is also a request
multiplier.
Three things stack up:
- **Retries.** A transient error, a slow load, a missing element, and the agent tries
the same step again. One logical action becomes three or five HTTP requests.
- **Re-planning.** When a step fails the agent often re-reads the page, or reloads it,
or navigates back and forward to re-orient. Each of those is a fresh visit to a URL a
human would have loaded once.
- **Exploration.** An agent that does not know the site's layout probes it: opens a
page to see what is there, backs out, opens another. A person who knows what they want
does not.
The result is that a single high-level task ("find the price of item X") can produce
ten or twenty page loads, most of them to the same few URLs, in a burst measured in
seconds. That pattern is trivial to count, and counting is exactly what a rate limiter
does.
## Rate limits read volume, not the browser
A fingerprint check and a rate limit answer two different questions, and a convincing
disguise only answers one of them: one asks whether this browser is real, the other only
counts how many requests just arrived.
A fingerprint check reads properties of the browser: the GPU string, the canvas hash,
the font list, the TLS handshake. It asks "is this a real browser". invisible_playwright
is built to make that answer yes, which is why it passes most of that class of check:
the engine is a genuine Firefox patched at the C++ level, so the values are real rather
than spoofed on top of a headless build.
A rate limit reads something completely different: how many requests arrived from this
address, this account, or this session, in this window. It does not open the browser at
all. It increments a counter and compares it to a threshold. The request could come from
the most convincing browser ever built and the counter would go up by exactly one.
So the two defences are orthogonal:
| Signal | What it reads | Does a real-looking browser help |
|---|---|---|
| Fingerprint / driver / TLS | Properties of the client | Yes - this is what the engine is for |
| Rate limit / quota | Count of requests over time | No - N requests is N requests |
| Per-account quota | Actions tied to one identity | No - the account is the unit, not the browser |
| Behaviour / velocity | Timing and shape of the traffic | No - the loop decides the timing |
The bottom three rows are not something an engine can fix, because the engine only
controls what one request looks like, not how many of them you send or how fast. That is
a property of the loop.
## Put the budget in the loop, not the engine
The consequence is a design rule: **backoff, throttling and a request budget belong in
the agent loop.** No browser setting throttles an agent that has been told to retry
until it succeeds.
Three controls cover most of it:
- **Exponential backoff on retry.** When a step fails, wait, and wait longer each time,
instead of retrying immediately. A failed request answered by an instant identical
request is the clearest velocity signal there is.
- **A hard request budget.** Cap the number of requests per task and per unit of time.
When the budget is spent, stop and surface the failure rather than letting the loop
spend the site's patience for you.
- **A cap on re-plans.** Bound how many times the agent may re-read or reload the same
URL before it gives up. An unbounded re-plan loop is an accidental refresh storm.
The unit to think in is requests per minute from one address and one account, not
requests per browser. Ten agents behind one exit IP each politely pacing themselves are,
to the counter, one very busy client.
## A retry loop that backs off
Here is the two-line launch plus a retry wrapper that carries a budget and backs off.
The browser is a stealth Firefox; the throttling is plain Python, because that is where
it has to be.
```python
import time
from invisible_playwright import InvisiblePlaywright
def fetch_with_budget(page, url, *, max_attempts=4, budget):
"""Load url with exponential backoff. Raises when the budget is spent."""
for attempt in range(max_attempts):
if budget["spent"] >= budget["limit"]:
raise RuntimeError("request budget exhausted; stopping instead of retrying")
budget["spent"] += 1
try:
page.goto(url, wait_until="domcontentloaded")
return page
except Exception:
if attempt == max_attempts - 1:
raise
backoff = 2 ** attempt # 1s, 2s, 4s, ...
time.sleep(backoff)
return page
budget = {"spent": 0, "limit": 30} # hard cap for the whole task
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
fetch_with_budget(page, "https://example.com", budget=budget)
# ... agent observes, decides, acts; every navigation goes through the budget
```
The `browser` returned is a real Playwright
[`Browser`](https://playwright.dev/python/docs/api/class-browser), so every standard
method works unchanged - `new_page`, `goto`, `click`, `wait_for_selector`. The stealth is
in the engine; the pacing is in `fetch_with_budget`. Nothing about `seed=42` slows the loop
down, and nothing about the loop changes the fingerprint. They are separate jobs.
Pacing the actions themselves matters too, because uniform, machine-fast timing is its
own tell independent of volume. That is the subject of
[the pause shaped like model latency](ai-browser-agents-stealth.md), and it is worth
reading alongside this page: one is about how many requests, the other about their
shape.
## What invisible_playwright fixes, and what it does not
The honest split, because overclaiming here is both wrong and a way to get someone
blocked while they trust a promise that was never true.
**What the engine handles.** The fingerprint, driver and TLS layers read as a genuine
Firefox, so the class of check that asks "is this a real browser driven by a real
person" mostly answers yes. That is measurable: on the public tampering suites a session
comes back internally consistent rather than flagged, and the same seed produces the
same machine every run so a failure is reproducible.
**What you supply.** The engine does not change your IP's reputation, it does not create
per-account quota out of nothing, it does not slow your loop down, and it does not shape
your timing. Those are yours to bring:
- A clean exit, because a real-looking browser on a
[datacenter IP is still on a datacenter IP](can-websites-detect-a-datacenter-proxy-ip.md),
and a counter on the address does not care how good the browser is.
- Human pacing, from the loop, using the controls above.
- Respect for the account's own limits, which are counted against the identity and not
the browser.
Put plainly: invisible_playwright makes each request look like it came from a real
person. It does not make a thousand requests look like one. That second job is the
loop's, and no engine setting will do it for you. When a clean fingerprint still gets
blocked, volume and address are the usual reasons -
[which is a page of its own](why-blocked-with-a-clean-fingerprint.md).
## Conclusion
Retries and re-planning are what make an agent an agent, and they are also what turn one
task into a burst of requests. A burst is counted, and a counter is a different defence
from a fingerprint check: the most convincing browser in the world still increments it by
one per request. So the throttle cannot live in the engine. Give the loop a budget, back
off on failure, cap the re-plans, and put a clean exit under it. The browser's job is to
make each request real; keeping the requests few and well-spaced is yours.
## Short answers to the questions that lead here
**Will a stealth browser stop my agent from being rate limited?** No. Rate limits count
requests; they do not inspect the browser. A real-looking fingerprint helps with
detection, not with volume.
**Why does my agent get blocked when a manual visit works fine?** Almost always because
the agent sent many more requests, much faster, than the person did. Retries and reloads
multiply traffic that a human never generates.
**Where should backoff and throttling live?** In the agent loop, not the engine. No
browser setting paces an agent that was told to retry until it succeeds.
**Does the seed or fingerprint affect how fast I can go?** No. The seed controls the
identity, not the timing. Speed and request count are decided entirely by your loop.
**Is a per-account quota a fingerprint problem?** No. A quota is counted against the
identity or the account, not the browser, so a better fingerprint does nothing for it.
Budget the actions instead.
**How many requests per minute is safe?** There is no universal number; it depends on
the site. The safe habit is a hard budget per task and per window, plus backoff, so a
failing loop stops itself rather than accelerating.
## Sources
- This project's own velocity flag, raised against invisible_playwright during testing,
which turned out to be the test harness hammering one scoring endpoint from one
address - the same volume signal described here, produced by our own gate.
- The wrapper's documented API (`InvisiblePlaywright`, seed reproducibility, a real
[Playwright `Browser`](https://playwright.dev/python/docs/api/class-browser) return)
as shipped, used verbatim in the example above.
**See also:** [the pause shaped like model latency](ai-browser-agents-stealth.md) for
the timing side of the same problem, [how to rate limit your scraper](how-to-rate-limit-your-scraper-playwright.md)
for the pacing mechanics in detail, and [what actually detects an agent](browser-use-detection.md)
across the layers a fingerprint does not cover.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The velocity flag that
started this page was ours, and it belonged to the harness, not the browser.*
+229
View File
@@ -0,0 +1,229 @@
---
title: "Why AI browser agents have their own timing signal"
description: "An LLM loop emits machine-regular action gaps and instant pointer jumps - a behavioral signal no fingerprint fixes. Where pacing and dwell time live in your code."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 10
---
# Why AI browser agents have their own timing signal
A stealth engine can make your browser read as a genuine Firefox down to the TLS
handshake, and an AI agent driving it can still stand out for a reason that has nothing
to do with the browser at all: the rhythm of the loop that controls it.
An LLM agent runs a think-act cycle. It looks at the page, decides on an action, emits
the action, waits for the result, and looks again. That cycle has a shape, and the shape
is measurable. The gaps between actions cluster around the model's latency, the actions
themselves land effectively instantly, and the pointer arrives at each target without a
human's approach, overshoot or correction. None of that is in the fingerprint. It is a
separate signal, orthogonal to every value a fingerprinting page reads, and a site can
check it on its own.
This page is about that signal: what produces it, why a clean fingerprint does not
touch it, and where the fix has to live, which is in your code and not in the engine.
## What the timing signal actually is
Behaviour is a fingerprint of a different kind. A fingerprinting page reads static
properties: the GPU string, the font list, the canvas hash. A behavioural check reads
the stream of events a session produces over time: when clicks happen relative to each
other, how a pointer travels between two points, how long a value takes to type, whether
anything is read before it is acted on.
A human session is full of small irregularities. There is a pause to read that varies
from a second to several. The pointer curves toward a target, arrives a little off, and
corrects. Typing has an uneven cadence with the occasional longer gap. Time is spent on
the page doing nothing measurable.
An agent loop, left to its own timing, produces almost none of that. The interesting
part is that this is true even when the engine underneath is perfect, which is what makes
it worth a page of its own.
## Why a perfect fingerprint does not touch it
invisible_playwright is designed to look like a real browser driven by a real person, and
that is why it passes most detection checks: the engine fingerprint, the TLS handshake and
the driver layer all read as a genuine Firefox rather than an automated one. That is a real
result and it is most of what people are blocked for.
It is also not everything. The same honesty that makes the product worth using means being
clear about the edges: on its own it does not fix IP reputation, per-account quotas, rate
limits, or behaviour. Those are supplied by you, a clean exit and human pacing among them.
The timing signal is squarely in that last category. The engine controls what the browser
*is*; it does not control the cadence at which your loop decides to act, because that cadence
is produced above the browser, in the code that calls it.
Put differently: a fingerprint is a photograph and behaviour is a motion study. Making the
photograph perfect does nothing to the motion study, and the two are read by different parts
of a detection system. This is the same reason the [testing method that catches false
passes](how-to-test-bot-detection.md) lists behaviour among the things no in-page suite
covers.
## What the loop leaks: gaps and pointer jumps
Two specifics, because they are the ones an agent produces without meaning to.
**Inter-action gaps that cluster.** Between one action and the next sits a wait for the
model to respond. That wait is not random the way a human pause is; it clusters around
whatever the model's latency happens to be, run after run. A distribution of gaps that is
tight and repeatable, rather than the broad, ragged spread a person produces, is itself the
tell. It does not matter that the individual number looks plausible. The *shape* of the
distribution is the signal.
**Actions that land instantly, and pointers that jump.** When an agent decides to click a
coordinate, the naive path is to dispatch the click at that coordinate with no travel and
no dwell. The pointer teleports from wherever it was to the target, and the action fires
with zero read time in front of it. A form filled field by field with no gaps, a click on
an element the instant it appears, a pointer that never passes through the space between two
targets: each is a motion no hand produces. The [detected-on-one-site checklist](playwright-detected-as-bot.md)
reaches this at step five, after the machine and the automation tells, because it is what is
left once the browser itself is clean.
invisible_playwright does smooth one piece of this for you: a click arcs the pointer to the
target on a Bezier curve rather than teleporting, so an individual click's *path* is
human-shaped. What it cannot smooth is the *cadence* between your actions and the dwell time
in front of them, because your loop, not the browser, decides when the next action happens.
## Pacing and pointer motion live in your code, not the engine
The consequence is a division of labour, and it is a clean one.
The engine owns the browser identity: the fingerprint, the TLS layer, the driver surface.
You own the rhythm: how long to dwell before acting, how much to vary the gap between
actions, whether to read the page before touching it. No engine can supply the rhythm for
you, because the rhythm is produced by the loop calling the engine, and that loop is yours.
Concretely, that means adding pacing and dwell to the code between your actions rather than
expecting the browser to add it underneath. Here is the minimal shape, using the real
two-line launch and standard Playwright methods on the returned browser:
```python
import random
import time
from invisible_playwright import InvisiblePlaywright
def dwell(low=0.6, high=2.4):
"""A varied pause, the kind reading and deciding actually produces."""
time.sleep(random.uniform(low, high))
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
dwell(1.2, 3.0) # read before acting, not act on arrival
page.click("#open") # the engine arcs the pointer on a Bezier curve
dwell()
for ch in "a search phrase": # per-key rhythm, not one instant fill
page.keyboard.type(ch)
time.sleep(random.uniform(0.04, 0.19))
dwell()
page.click("#submit")
```
The `browser` returned by `InvisiblePlaywright` is a real Playwright `Browser`, so every
method is the one you already know; the `seed=42` makes the identity reproducible so a run
that gets flagged can be replayed exactly. The only thing added above the plain automation is
the pacing, and that is the point: it has to be added, because it is the part the engine
cannot produce for you.
A note on doing it well. Uniform delays are their own tell. `time.sleep(1.0)` between every
action just moves the cluster from "instant" to "exactly one second", and a tight cluster at
one second is as machine-regular as a tight cluster at zero. Vary the pauses, make them
depend on what the step is doing (a long read before a decision, a short gap between two
keystrokes), and avoid the same number twice. The goal is the ragged, context-dependent
spread a person produces, not a constant with a label on it.
## Measuring your own rhythm before a site does
You can read this signal off your own agent the same way a site would, which is the honest
way to know whether your pacing is doing anything. Record a timestamp at each action, then
look at the distribution of the gaps.
```python
import time
timestamps = []
def mark():
timestamps.append(time.monotonic())
# call mark() immediately before each page action, then afterward:
gaps = [b - a for a, b in zip(timestamps, timestamps[1:])]
print("count:", len(gaps))
print("min / max:", round(min(gaps), 3), round(max(gaps), 3))
print("mean:", round(sum(gaps) / len(gaps), 3))
```
If the min and max are close together, or the mean sits right on top of your model's
typical response time, your loop is emitting the clustered distribution described above and
the pacing is not varied enough yet. A human trace has a wide spread and a long tail. This is
the same instinct as reading the fingerprint report field by field rather than trusting a
verdict: measure the actual stream, do not assume the shape. For the related case of an agent
whose pauses line up with tool latency in a devtools context, see
[timing detection through the debugger](debugger-timing-detection.md).
## Conclusion
The engine fingerprint and the agent's rhythm are two different signals, read by two
different parts of a detection system, and a stealth browser addresses the first and not the
second. invisible_playwright makes the browser read as a genuine person's Firefox, which is
why it clears most checks; the cadence of your think-act loop is produced above the browser,
so pacing, dwell time and read-before-act have to live in your own code. Add them
deliberately, vary them so they are not merely a slower constant, and measure your own trace
the way a site would. That is the honest division of labour, and it is the one that holds up.
## Short answers to the questions that lead here
**Does a stealth browser hide that I am an AI agent?** It hides that the browser is
automated. It does not hide the rhythm of your control loop, which is a separate signal you
produce above the browser.
**What is the timing signal, exactly?** The gaps between your actions cluster around the
model's latency instead of spreading like a human's pauses, and actions land instantly with
pointers that jump straight to targets. Both are visible without reading any fingerprint.
**Can invisible_playwright fix my pacing for me?** No, and no engine can. It smooths an
individual click's pointer path on a Bezier curve, but the cadence between actions is decided
by your loop, so pacing and dwell have to live in your code.
**Do I just add a fixed sleep between actions?** That helps with "instant" but creates a new
tell: a tight cluster at one second is as regular as a tight cluster at zero. Vary the pauses
and make them depend on the step.
**Will fixing the timing get me past everything?** No. Behaviour is one signal among several.
A clean rhythm on a bad IP, over quota, or against a rate limit still fails; those are yours
to supply too, a clean exit and sane request volume among them.
**How do I know if my rhythm looks robotic?** Record a timestamp at each action and look at
the spread of the gaps. If min and max are close, or the mean sits on your model's response
time, the distribution is too tight.
## Sources
- This project's own testing notes, which list behaviour and the pause shaped like model
latency among the things no in-page suite covers.
- Standard Playwright's documented [`Browser`](https://playwright.dev/python/docs/api/class-browser),
[`Page`](https://playwright.dev/python/docs/api/class-page) and
[`Keyboard`](https://playwright.dev/python/docs/api/class-keyboard) methods, used unchanged
on the browser this wrapper returns.
- The behavioural step of this set's detected-on-one-site checklist, which reaches pointer
motion and typing cadence after the browser itself is clean.
**See also:** [what fits and what does not for AI browser agents](ai-browser-agents-stealth.md),
[why a CDP-driven agent has a tell of its own](browser-use-detection.md), and
[testing bot detection without a false pass](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The engine makes the browser
real; the rhythm is yours to write, and this page is the part I keep having to add back into
my own agent loops.*
+230
View File
@@ -0,0 +1,230 @@
---
title: "AI browser agents and stealth: what fits and what does not"
description: "Most AI browser agents drive Chromium over CDP, so a stealth Firefox does not drop in. What each tool exposes, checked from source, and what applies regardless."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 1
---
# AI browser agents and stealth: what fits and what does not
Most AI browser agents cannot run a stealth Firefox, because they speak the Chrome
DevTools Protocol (CDP) and Firefox does not answer it. The few built on Playwright can
select Firefox in principle, but rarely expose a custom binary. And on a server the engine
is usually not what gets the agent blocked in the first place.
If your agent works on your laptop and gets challenge pages on a server, there are two
separate questions and they get answered as one. The first is whether you can swap the
browser underneath. The second is whether swapping it would fix your problem.
For most of these tools the first answer is no, for a reason that is structural rather
than accidental. The second answer is often no as well, and for a different reason.
This page is what each project actually exposes, checked by reading its source, the split
that decides all of it, what applies no matter which engine you run, the signal specific
to agent-driven sessions, and the one route that does accept a different engine.
## The split that decides everything: CDP or Playwright
Browser automation divides into two families and the boundary matters more than any
configuration option.
**Tools that speak the Chrome DevTools Protocol** talk directly to a Chromium-family
browser. CDP is Chromium's own protocol. Firefox does not implement it in the way these
drivers expect, so an `executablePath` pointing at a Firefox build does not produce a
working session: the driver would be speaking a language the browser does not answer.
**Tools built on Playwright** go through an abstraction that already supports
[three engines](https://playwright.dev/docs/browsers) - Chromium, Firefox and WebKit.
Swapping the binary is then a question of whether the tool exposes the launch option,
not of whether the protocol matches.
Almost every AI browser agent is in the first family. That is a reasonable engineering
choice, since CDP gives fine-grained control that agent loops want, and it is also why
"can I use a stealth Firefox with my agent" usually has a short answer.
## What each project actually exposes
Only two of these five projects expose a custom-binary option, and both expect a Chromium
build. The table below is read from each repository on 2026-07-27 and 2026-07-28, with
star counts from the same check.
| Project | Stars | Family | Custom binary | Firefox |
|---|---|---|---|---|
| browser-use | 107k | CDP, Chrome | `executable_path` on `BrowserProfile` | no |
| Stagehand | 24k | CDP, Chromium | `executablePath`, documented | no |
| Skyvern | 23k | CDP | not exposed | no |
| crawl4ai | 75k | Playwright | **no `executable_path`** | `browser_type="firefox"` |
| Maxun | 17k | Playwright | not exposed | not exposed |
Three others that come up in these searches are not Playwright tools at all:
`agent-browser` and `obscura` are written in Rust, and `BrowserOS` has no Playwright
dependency in its manifest. Star count does not tell you what a project drives.
### browser-use
The configuration is real: `executable_path`, `channel`, `user_data_dir`, `proxy`, `args`
and `headless` on `BrowserProfile`. The surrounding code is Chrome executable discovery
and Chrome profile handling, and the channel type is a Chromium channel.
The useful move there is pointing `executable_path` at your **real installed Chrome**
rather than the bundled Chromium, and pointing `user_data_dir` at a profile that has been
used. [The full version is here](browser-use-detection.md).
### Stagehand
Exposes `executablePath` and documents it, which is more than most. The rest of the
codebase is CDP: local CDP discovery, CDP tailing, a CDP client. Chromium references
outnumber Firefox ones by a wide margin, and the Firefox mentions are in an OpenAPI
schema and a client for someone else's API rather than in a launch path.
So the option exists and it expects a Chromium build.
### Skyvern
CDP throughout. There is no exposed way to point at a different binary, and the protocol
would not match if there were.
### crawl4ai
The only one of these built on Playwright with Firefox genuinely selectable, through
`browser_type="firefox"`. What is missing is any field naming a binary, so you get
Playwright's managed build. Its own stealth mode applies `playwright-stealth`, which its
documentation notes does not support Firefox, so that combination is largely inert.
[The full version is here](crawl4ai-stealth-custom-browser.md).
### Maxun
Playwright is in the manifest and no executable path is exposed. As a no-code platform
that is a coherent product decision rather than an oversight.
## What applies regardless of the engine
Swapping the browser engine changes none of the tells a server leaks, and those tells
matter more than the binary question because they are true for every tool, CDP or
Playwright. On a server, all of these are true at once and none of them is about
automation:
- **No GPU**, so WebGL reports a software renderer.
[What those strings give away](webgl-renderer-strings.md).
- **A container font set** that does not match the claimed platform.
[Why installing more is not the fix](headless-fonts-differ.md).
- **No audio device**, and no speech voices.
[The seven audio values](audiocontext-fingerprinting.md) and
[the voice list](speech-synthesis-voices.md).
- **A screen with no taskbar** and a default resolution.
[The relationships that must hold](screen-size-headless-tells.md).
- **Codec support** describing a slim build, including whether decoding is hardware
accelerated. [Three surfaces in one API](codec-fingerprinting.md).
- **A TLS handshake** decided before any of this.
[Which nothing above the network stack can reach](ja3-ja4-tls-fingerprint.md).
Swapping the browser engine does not change a single item on that list. If your agent
fails in a container and works on your laptop, this is almost certainly where the
difference is, and it is the same for a CDP tool and a Playwright tool.
[The container walkthrough](playwright-docker-detection.md) goes through it in order.
## The signal that is specific to agents
One signal no fingerprint work touches is the rhythm of the agent loop itself. An agent
thinks between actions: it reads the page, calls a model, waits, then acts. The resulting
rhythm has a shape no person produces.
- Long pauses clustered around **model latency** rather than around reading speed.
- **No movement during the pause.** A person drifts, scrolls slightly, hovers. An agent's
pointer is motionless for two seconds and then arrives.
- Actions landing **dead centre** on targets, because coordinates come from an
accessibility tree rather than from a hand.
- **No wasted actions.** People hover over things they do not click and change their
minds.
This explains blocks that arrive **after** a few interactions rather than at first load,
and that timing is the cheapest diagnostic you have.
[Human-like pointer motion](human-mouse-movement.md) covers what can be done about the
mechanical half, and it is honest that the deliberation pattern is a different problem.
## This stopped being a theoretical concern in 2026
Agent-driven browsing used to be rare enough that most detection stacks didn't bother
building a dedicated signal for it. That changed this year. Fingerprint, the
commercial fingerprinting vendor behind FingerprintJS, shipped a product in early
2026 specifically aimed at classifying AI agent traffic - not bot detection in
general, agent detection as its own category, with its own signal set. Academic
research published in the same period has been measuring the same target directly:
building multi-layer fingerprints specifically to separate an LLM-driven browsing
session from a human one, using exactly the rhythm-based signals described above
plus whatever else the page surface gives away.
The practical upshot for anyone running an agent against a real site: the timing
and pointer-behavior signal in the previous section is not a corner case anymore.
It is an active, funded area of detection work, aimed specifically at the traffic
pattern an agent loop produces, independent of whatever engine sits underneath it.
Fixing the browser's fingerprint and fixing the agent's behavior are now both live
requirements, not one obvious fix and one theoretical afterthought.
## The route that does accept a different engine
If you want an engine whose fingerprint is set in its own source and you want an agent to
drive it, the working combination today is MCP rather than CDP.
Microsoft's `playwright-mcp` accepts a browser and an executable path and speaks MCP, so
any agent framework that talks MCP can drive a patched Firefox through it.
[That integration is written up here](integrations/playwright-mcp.md).
The trade is explicit: you give up the agent loop of whichever framework you were using
and get an engine-level fingerprint. Whether that is worth it depends on which of the two
problems at the top of this page you actually have.
## Conclusion
The honest summary is that the agent ecosystem standardised on CDP, and CDP means
Chromium. A Firefox engine does not drop into browser-use, Stagehand or Skyvern, and
crawl4ai is one missing field away rather than one protocol away.
More importantly, for most people the engine is not the binding constraint. The container
is. Every item in the machine list above is true whichever tool you picked, and none of
them is fixed by a stealth setting inside it.
Work out which problem you have first: a block at the first request points at the machine
or the address, and a block after several actions points at behaviour.
## Short answers to the questions that lead here
**Can I use a stealth Firefox with browser-use?** No. It drives Chrome over CDP.
**Does Stagehand support a custom browser?** Yes, `executablePath`, and it expects a
Chromium build.
**Can crawl4ai use a patched engine?** Not through configuration. It accepts
`browser_type="firefox"` but has no field naming a binary.
**Why does my agent work locally and fail in Docker?** Because the container answers
differently about the GPU, the fonts, the audio device and the screen. The agent is
identical.
**Which AI agent framework is most stealth-friendly?** The question is usually the wrong
one. Pick on the agent loop, then fix the machine, then consider the engine.
**Is there any agent route to an engine-level fingerprint?** MCP, through Microsoft's own
Playwright MCP server, which takes a browser and an executable path.
**See also:** [browser-use in detail](browser-use-detection.md),
[crawl4ai in detail](crawl4ai-stealth-custom-browser.md),
[Playwright MCP](integrations/playwright-mcp.md), and
[the checklist for being detected on one site](playwright-detected-as-bot.md).
## Sources
- `browser_use/browser/profile.py` and `chrome.py`; Stagehand's
`packages/core/lib/v3/launch/local.ts` and its browser configuration docs; Skyvern's
CDP client; `crawl4ai/async_configs.py`; Maxun's package manifest. All read
2026-07-27 and 2026-07-28.
- Star counts from the GitHub API on the same dates.
- The machine-level surfaces are each documented on their own page, linked above.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. This page exists because eight separate articles all
concluding "does not fit" would have been worse for you than one that says why.*
@@ -0,0 +1,211 @@
---
title: "What is ASN and IP reputation in bot detection?"
description: "What ASN and IP reputation are: how they score requests before JavaScript runs, how reputation builds and decays, and why a clean browser on a burned IP loses."
parent: "Network, Proxy and WebRTC"
grand_parent: "Guides"
nav_order: 23
---
# What is ASN and IP reputation in bot detection?
An ASN identifies which network operator an address belongs to, and IP reputation is the
abuse history attached to that address; together they let a detector score a connection
before a single line of JavaScript runs. This is the layer a browser cannot touch, and it
is why a session with a flawless fingerprint can still be turned away at the door.
This page explains what an ASN is, how IP reputation gets built and how it decays, why a
perfect browser on a flagged block loses anyway, and where the browser's job ends and the
proxy's job begins.
## What an ASN actually is
An ASN, an [Autonomous System Number](https://datatracker.ietf.org/doc/html/rfc1930),
identifies the network operator that announces a block of IP addresses to the rest of the
internet. A residential internet provider has one or more ASNs. A cloud host has its own.
When a connection reaches a server, the server can look up the address and learn, in a
single query, which operator it belongs to and what kind of operator that is.
That last part is the point. ASNs carry a category. A range that belongs to a consumer
internet provider looks like a person at home. A range that belongs to a hosting company
or a cloud region looks like a server, because that is what almost everything in it is.
The lookup is cheap, it happens at the very first packet, and it does not care in the
slightest what browser you plan to run. A datacenter ASN is a strong prior on its own:
real customers rarely browse a shopping site from a cloud region, so a request from one
starts the session already suspected. This is covered in more depth in
[can websites detect a datacenter or proxy IP](can-websites-detect-a-datacenter-proxy-ip.md),
and the short version is that they can, directly, at the network layer.
## How IP reputation is built and how it decays
The ASN category is the coarse signal. Reputation is the fine one, and it is per-address
and per-block rather than per-operator.
A reputation service records what addresses have done. If a particular IP, or the /24
block around it, has recently been the source of credential-stuffing traffic, scraping
runs, spam, or a burst of failed logins, that history attaches to the address. It is
shared: the block was burned by whoever used it before you, and you inherit the score. A
single address can also burn itself inside one session, purely by volume. If one IP opens
several hundred sessions against the same endpoint in an hour, that velocity is itself the
signal, independent of how human each individual session looks.
Reputation decays, but slowly and unevenly. An address that sat quiet for a long stretch
recovers some standing. An address that is being actively abused right now does not, and
the decay resets every time the block is used again. This is why a cheap shared proxy
never really recovers: the moment its score drifts back toward neutral, the next user on
the same block drives it back down. You are not renting a clean address, you are renting a
position in a queue of people degrading it.
Three inputs, then, all read before the browser matters: the ASN's category, the block's
abuse history, and the live session count from that address.
## Why a perfect fingerprint on a burned block still loses
A perfect fingerprint on a burned block still loses because a detector scores the network
layer and the fingerprint layer independently, and a flawless browser can only zero out the
second one - it has no way to reach the first.
invisible_playwright is designed to look like a real browser driven by a real person. The
fingerprint is coherent, the TLS handshake belongs to a genuine Firefox, and the driver
layer does not announce automation. That is why it passes most detection checks: the parts
a browser controls, it controls well. What it cannot do is change the address the
connection arrives on. A coherent browser on a burned IP is still on a burned IP.
The two layers are scored independently and both have to be right. Picture a detector as
adding up evidence. The network layer contributes its verdict, a datacenter ASN or a block
with recent abuse, before any script runs. The fingerprint layer contributes its verdict
after. A perfect browser sets the second contribution to roughly zero, which is exactly
what you want, but it cannot make the first contribution negative. If the network layer
alone crosses the threshold, the session is challenged or blocked no matter how clean
everything downstream reads. This is the mechanism behind
[being blocked with a clean fingerprint](why-blocked-with-a-clean-fingerprint.md): nothing
is wrong with the browser, and the browser was never the thing that failed.
You can prove which layer you are hitting in about a minute. Open the same URL by hand,
from the same machine and the same exit, in a stock browser. If the manual visit is also
challenged, the browser is not your problem and no fingerprint change will help. If the
manual visit passes and the automated one does not, the difference is in the browser or
the behaviour, and that is a different investigation entirely.
## Where the browser ends and the proxy begins
The division of labour is clean, and being clear about it saves a lot of wasted effort.
The browser's job is everything the server reads after the connection is established: the
fingerprint fields, the TLS handshake, the absence of automation tells, the driver layer.
invisible_playwright handles those from one seed, reproducibly. Your job, the part the
browser cannot do for you, is three things it has no access to.
- **A clean exit.** An address on a consumer ASN, on a block without recent abuse, not
already shared by a crowd. Around 90% of proxy addresses are public and therefore
already known and scored before you send a byte through them. The clean fraction is the
part worth paying for.
- **Human pacing.** Session count per address is a reputation input, so hundreds of
sessions from one IP burns it regardless of browser quality. Spread the work across
addresses and across time.
- **Behaviour and quotas.** Per-account limits, rate limits, and the timing of your
actions are yours to supply. The browser looks human; whether it acts human is up to
the code driving it.
One more thing that is genuinely the browser's job and is easy to mistake for a network
problem: the browser and the exit have to tell the same story. An exit in one country
behind a browser claiming another is a contradiction the detector reads directly, and it
is cheap to get right. invisible_playwright derives the timezone from the egress IP by
default, which is why
[a timezone that does not match the proxy](timezone-proxy-mismatch.md) has its own page.
## A runnable example
The browser side is two lines. You supply the proxy; the wrapper wires it, routes DNS
through it, and derives the timezone from its exit so the browser and the network agree.
```python
from invisible_playwright import InvisiblePlaywright
proxy = {
"server": "socks5://gate.example.com:1080",
"username": "user",
"password": "pass",
}
# seed=42 makes the identity reproducible; the proxy is the exit you supply
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
# confirm the exit the browser is actually leaving from,
# rather than assuming it
page.goto("https://example.com/ip")
print(page.inner_text("body"))
```
The `browser` object is a real Playwright
[`Browser`](https://playwright.dev/python/docs/api/class-browser), so every standard
method works exactly as documented upstream. Note what the example does and does not
claim: it pins the fingerprint so a failure is reproducible, and it reads back the exit so
you know which address your reputation is riding on. It does not make a bad address good.
If the printed IP sits on a datacenter ASN or a burned block, the cleanest browser in the
world is still leaving from there.
## Conclusion
ASN and IP reputation are the part of bot detection that runs before your browser gets a
turn. The ASN says what kind of network you are on, the reputation says what that address
and its neighbours have been doing, and the session count says how hard you are leaning on
it right now. All three are read at connection time, none of them are in a browser's
gift to change, and a perfect fingerprint sets its own layer to zero without touching
theirs.
So the honest framing is the useful one. invisible_playwright makes the browser layer look
like a real person's real browser, which is most of the battle and the part most tools get
wrong. The network layer is yours: a clean exit, human pacing, and quotas you respect. Get
both right and the session passes. Get the browser perfect on a burned block and it does
not, and now you know exactly why.
## Short answers to the questions that lead here
**What is an ASN in bot detection?** The number identifying the network operator that owns
the address you connect from. Detectors read it at the first packet to learn whether you
look like a home connection or a datacenter, before any JavaScript runs.
**Can a good fingerprint fix a bad IP?** No. The two are scored independently. A perfect
browser zeroes out its own layer but cannot make a burned or datacenter address look
clean, so the session can still be blocked on the network verdict alone.
**Why does my clean browser still get blocked?** Almost always the exit. Prove it by
opening the same URL by hand from the same machine and exit in a stock browser; if that is
challenged too, the browser was never the problem.
**How does an IP get a bad reputation?** From abuse history on the address or its block,
inherited from whoever used it before you, plus live session volume. Shared cheap proxies
never recover because the next user re-burns the block as it decays.
**Does invisible_playwright give me a clean IP?** No, and it does not claim to. It handles
the browser fingerprint, TLS and driver layers. You supply the proxy, the pacing and the
quotas; the browser cannot change the address it arrives on.
**How many sessions can one IP make?** Fewer than you would like, because session count is
itself a reputation input. Hundreds of sessions from one address burns it regardless of
how human each session looks. Spread across addresses and across time.
## Sources
- [RFC 1930](https://datatracker.ietf.org/doc/html/rfc1930), the IETF guidelines that
define an Autonomous System as a routing policy unit and specify the ASN that identifies
it.
- [Playwright's `Browser` class reference](https://playwright.dev/python/docs/api/class-browser),
for what a launched `Browser` object exposes once the wrapper hands it back.
- This project's release and validation gates, which test the browser layer through a real
proxy and confirm the exit address inside the browser rather than assuming it.
- The network-layer behaviour described here is read from public reputation and ASN-lookup
mechanics, cross-checked against the browser layer this project controls.
**See also:** [can websites detect a datacenter or proxy IP](can-websites-detect-a-datacenter-proxy-ip.md)
for the network layer in detail, [browser trust scores explained](browser-trust-score-explained.md)
for how the fingerprint layer is scored separately, and
[why you can be blocked with a clean fingerprint](why-blocked-with-a-clean-fingerprint.md)
when every browser check comes back green.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser layer is the
part we can make perfect; the IP is the part only you can keep clean.*
+192
View File
@@ -0,0 +1,192 @@
---
title: "AudioContext fingerprinting, and why adding noise backfired"
description: "AudioContext fingerprinting is usually beaten with noise. We shipped that defence, measured it, and it made sessions easier to detect. The seven values and why."
parent: "Canvas, WebGL, Fonts and Audio"
grand_parent: "Guides"
nav_order: 8
---
# AudioContext fingerprinting, and why adding noise backfired
Audio fingerprinting has a reputation for being hard to defeat. It deserves it, but
not for the reason usually given.
The usual reason is that the audio pipeline is low-level and mathematically involved.
The real reason is simpler and more annoying: **the obvious defence makes you easier
to detect, not harder.** We shipped that defence, measured it, and turned it off. This
page is what the measurements said.
## What is actually being measured
Audio fingerprinting collects seven values from the [Web Audio
API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API), a rendered
sample buffer plus six device and analyser readings, and checks that they agree with
each other. Almost every guide stops at "it hashes how your device processes sound",
which is true and useless. Here is the concrete shape.
A fingerprinting script builds a short offline audio graph, usually an oscillator into
a dynamics compressor, renders it without playing anything, and reads the resulting
samples back:
```js
const ctx = new OfflineAudioContext(1, 44100, 44100);
const osc = ctx.createOscillator();
const comp = ctx.createDynamicsCompressor();
osc.connect(comp); comp.connect(ctx.destination);
osc.start(0); ctx.startRendering();
// then: sum the rendered samples, hash the sum
```
But the rendered buffer is only one of the values collected. The full set is wider
than people expect, and this matters because they have to agree with each other:
| Value | What it is |
|---|---|
| `AudioContext.sampleRate` | 44100 or 48000, from the audio device |
| `AudioContext.outputLatency` | the driver's reported latency |
| `AudioContext.destination.maxChannelCount` | stereo, 5.1, whatever the device has |
| the rendered sample sum | the oscillator-compressor output |
| `AnalyserNode` frequency data sum | the same graph seen through an FFT |
| `AnalyserNode` time domain data sum | the same graph in amplitude |
| `DynamicsCompressorNode.reduction` | one float, the applied gain reduction |
Seven values, one machine. A profile claiming a 5.1 sound card with a laptop's latency
and a rendered buffer that belongs to neither is caught by comparison, and no
individual value in it is unusual.
## The mistake: noise that gets asked about twice
The intuitive defence is the canvas one: add a small amount of noise to the rendered
samples so the hash differs per session. We implemented exactly that, seeded so the
same identity always produced the same audio.
Two things went wrong, and the second one is the interesting one.
### Silence is a trap
[CreepJS](https://abrahamjuliot.github.io/creepjs/) has a check called
`hasFakeAudio`. It does not compare your hash to a database. It builds a buffer that
should be **silent**, renders it, and looks at whether anything is in it.
```js
new OfflineAudioContext(1, 100, 44100) // 100 samples, oscillator frequency 0
```
Nothing should come out of that. On real hardware nothing does. A tool adding noise to
every rendered buffer puts noise into silence, which is physically impossible, and the
check records a lie.
It also inspects the first 100 samples of a normal buffer and counts distinct values
there, for the same reason: the beginning of a render is predictable, so variation
there is manufactured.
The fix is not to stop adding noise, it is to add it only where noise can legitimately
exist: skip buffers short enough to be a probe, skip the opening samples, and skip
channels that carry no input at all. Noise on a silent channel is not subtle. It is a
claim that your sound card produces sound when it is off.
**The general shape, which is worth more than the specific check:** a detector does not
have to recognise your noise. It only has to ask a question whose correct answer is
*nothing*, and see whether it gets something.
### The defence was the signal
The second problem was not expected: with the noise correctly guarded and passing the
silence checks, a commercial fingerprinting service still scored the browser as
tampered. We isolated the audio noise with a kill switch and ran it both ways on the
same machine and the same identity:
| Audio noise | tampering score |
|---|---|
| on | 0.4349 |
| off | 0.0564 |
Nearly an order of magnitude, from one feature. The audio noise was not one
contributor among many, it was the dominant one.
So we ship with it **off**. The un-noised audio output is still host-independent,
because the values around it are set from the seed and the render is deterministic, and
it matches what a real Firefox on that configuration produces. Turning the noise off
did not make sessions linkable: it made them identical to the honest answer, which is
what everything else on that machine is claiming anyway.
That inversion is the lesson worth carrying:
> A randomised value is not automatically safer than a fixed one. If everyone with a
> given browser and OS produces the same audio hash, producing that same hash makes you
> one of them. Producing a unique one makes you the only person on the internet whose
> sound card is a snowflake.
Randomising helps where the honest value identifies your specific machine. It hurts
where the honest value identifies your *class* of machine, because there the crowd is
the disguise.
## Getting the details right, if you do add noise
Two things we got wrong on the first attempt and had to measure our way out of.
**Scale is per-surface.** Frequency data is in decibels, roughly -100 to 0. Time domain
data is amplitude, -1 to 1. The same epsilon on both is either invisible on one and
enormous on the other. We ended up around `1e-4` for frequency, `1e-7` for time domain,
and `1e-5` for the compressor's single reduction float.
**The noise has to be a function of the seed and the position, not of a random number
generator.** If it is random per call, reading the same value twice returns two
different answers, and a script that reads it twice is a script anyone can write. Ours
hashes the seed together with the channel index and the sample position, so the same
identity renders the same buffer forever, and two reads agree.
That second point is the one that catches most tools. It is easy to check and it is
checked.
## What to look at on your own setup
```js
const ctx = new AudioContext();
console.log(ctx.sampleRate, ctx.outputLatency, ctx.destination.maxChannelCount);
ctx.close();
```
- **`sampleRate` is 44100 or 48000.** Anything else is rare enough to be interesting.
- **The three device values describe one plausible device.** A 5.1 channel count with a
laptop latency is two devices in one answer.
- **[`outputLatency`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/outputLatency)
is not zero and not identical across machines.** A container with no sound device is
a real tell here, in the same way that [a machine with no GPU is one for
WebGL](webgl-renderer-strings.md).
- **Read the rendered sum twice in one session.** It must match. If it does not, your
noise is per-call, and that is the single cheapest tampering check there is.
- **Render a silent buffer and confirm it is silent.**
## Short answers to the questions that lead here
**Can I just disable AudioContext?** You can, and then you have a browser without the
Web Audio API, which every real browser has. That is a stronger signal than any hash.
**Do the privacy extensions that randomise audio work?** They stop the hash being
stable, which is what they promise. They also generally randomise per call and put
noise in silence, both of which are detectable in one line. Against tracking, they
help. Against a system asking whether you are tampering, they are the thing it finds.
**Is audio fingerprinting stronger than canvas?** It has less entropy on its own. It is
harder to fake convincingly, because it is seven values that have to agree plus a
render that has to look like it came from the device the other six describe.
**Why does my audio fingerprint differ between headless and headed?** Usually the audio
device. A headless container often has none, so the values fall back to defaults that
say so.
**See also:** [why a FingerprintJS visitor ID changes](fingerprintjs-visitor-id.md),
since the audio hash is one of the components that ID is made of,
[why headless browsers render different fonts](headless-fonts-differ.md)
and [your renderer string says NVIDIA, your pixels say software](renderer-string-vs-render.md),
which are the same "the honest answer describes your machine" problem on other
surfaces, and [how CreepJS decides you are lying](creepjs-explained.md).
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. The two scores above are our own A/B, on one
machine and one identity, with the audio noise as the only variable. The feature they
killed was one we wrote.*
@@ -0,0 +1,226 @@
---
title: "AudioContext sampleRate and latency as a fingerprint"
description: "AudioContext.sampleRate, outputLatency and maxChannelCount are read from the audio driver, so a headless server leaks. How a seeded browser keeps them coherent."
parent: "Canvas, WebGL, Fonts and Audio"
grand_parent: "Guides"
nav_order: 13
---
# AudioContext sampleRate and latency as a fingerprint
An `AudioContext` fingerprints a machine before it renders a single sample: `sampleRate`,
`outputLatency` and `destination.maxChannelCount` are read straight from the operating
system's audio driver, so a headless server with no sound hardware answers them with
tell-tale defaults. The defence is not to spoof each number, but to return all three as
one coherent device profile that a real machine could actually have.
Most writing about audio fingerprinting is about the rendered buffer: you run an
`OfflineAudioContext`, hash the samples it produces, and treat that hash as the signal.
That is a real surface and it has [its own page here](audiocontext-fingerprinting.md).
This page is about the other half, the part that needs no rendering at all. Before a
single sample is generated, an `AudioContext` already exposes three plain numbers that
come straight from the operating system's audio stack: `sampleRate`, `outputLatency`,
and `destination.maxChannelCount`. They are cheaper to read than any buffer hash, they
are stable within a session, and on a headless server they are one of the clearest
tells that no real sound hardware is present.
## The three numbers a real audio stack exposes
Open an `AudioContext` on a normal desktop and read four fields:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
profile = page.evaluate("""() => {
const ctx = new AudioContext();
const out = {
sampleRate: ctx.sampleRate,
outputLatency: ctx.outputLatency,
baseLatency: ctx.baseLatency,
maxChannelCount: ctx.destination.maxChannelCount,
};
ctx.close();
return out;
}""")
print(profile)
```
Each of those fields is a question to the driver, not to the browser:
- **`sampleRate`** is the rate the audio device is running at, almost always `44100` or
`48000` Hz. It is decided by the sound card and its driver, not by the page.
- **`outputLatency`** is roughly how long it takes a sample to travel from the graph to
the speaker. It reflects the buffer size the driver negotiated, and it differs between
onboard audio, a USB interface, and a surround setup.
- **`maxChannelCount`** on the destination node is how many output channels the device
can drive: `2` for ordinary stereo, `6` for a 5.1 setup, `8` for 7.1.
None of these is an automation flag. They are hardware facts, and that is exactly what
makes them useful to a detector: JavaScript cannot invent a sound card it does not have.
## Why the values have to agree with each other
The trap here is not any single value being unusual. Every one of these numbers, taken
alone, is common. The signal is in the combination.
Real devices come in a small number of shapes. Onboard laptop audio tends to run stereo
at 48000 Hz with a modest latency. A cheap USB headset might report 44100 Hz. A discrete
sound card feeding a 5.1 receiver reports six channels and a latency in a range that
matches a card built for that job. What you never see on real hardware is the
cross-product: a `maxChannelCount` of 6 paired with the sample rate and latency of a
thin laptop codec, because no such device exists.
That cross-value contradiction is precisely what a consistency-minded detector looks
for, and it is the same class of check that catches a Windows user agent over a Linux
font set, or [hardware concurrency and device memory](hardware-concurrency-device-memory.md)
that pair oddly with the machine being claimed. A fingerprint is not a list of values,
it is a set of relationships, and the relationships are where a naive spoof falls apart.
## What a headless container reports instead
Run the same three reads inside a server container with no sound hardware and you get one
of two failure shapes, both of them loud.
The first is a null audio backend: the context comes back with a default sample rate and
a latency that is suspiciously round or zero, the same on every container image, because
there is no driver underneath negotiating anything. A value that is byte-identical across
thousands of visitors is not neutral, it is a cohort.
The second is worse. Some headless setups fail to construct the context at all, or
suspend it immediately, so the page sees a `state` that never reaches `running`. As with
every other surface, [an empty or blocked result is itself a signal](how-to-test-bot-detection.md),
not a clean pass. A detector that records suppression by name counts the absence against
you exactly as it would count a wrong value.
This is the same reason [an empty speech-voice list](speech-synthesis-voices.md) gives a
server away: both audio output and installed voices are reads into the operating system,
and a datacenter answers them with defaults that say "datacenter".
## How this browser keeps the profile coherent
The fix is not to pick three plausible numbers independently, because independent draws
are what produce the impossible device. The engine returns all three together as one
coherent profile, chosen for the session from a small set of real device archetypes, so
the values always describe a machine that could actually exist:
| Device archetype | `sampleRate` | `outputLatency` | `maxChannelCount` |
|---|---|---|---|
| Plain stereo desktop | 44100 Hz | around 40 ms | 2 |
| USB audio interface | 48000 Hz | lower, near 30 ms | 2 |
| 5.1-capable sound card | 48000 Hz | near 40 ms | 6 |
Each row is a machine that exists; the impossible combinations between rows are the ones a
detector is looking for.
Because the whole profile is keyed off the session seed, a six-channel destination never
lands next to a laptop's latency, and the same seed reproduces the same audio device on
every run. The three fields move as a unit, which is the property the detector is testing
for. This is the general principle these patches follow: the goal is to look like a real
machine, not merely to avoid an obvious default, and a suppressed or arbitrary value
fails that goal as surely as a wrong one.
## Measuring it yourself with a fixed seed
The point of a seed is that a finding is reproducible. Read the profile under two seeds
and confirm two things at once: that each profile is internally coherent, and that the
same seed returns the same device every time.
```python
from invisible_playwright import InvisiblePlaywright
READ = """() => {
const ctx = new AudioContext();
const out = [ctx.sampleRate, ctx.destination.maxChannelCount,
Math.round((ctx.outputLatency || 0) * 1000)];
ctx.close();
return out;
}"""
for seed in (42, 1337):
with InvisiblePlaywright(seed=seed) as browser:
page = browser.new_page()
page.goto("https://example.com")
rate, channels, latency_ms = page.evaluate(READ)
print(f"seed={seed}: {rate} Hz, {channels} ch, ~{latency_ms} ms")
```
Two checks turn this into evidence rather than a single reading:
1. **Run each seed twice.** The tuple must be identical across runs of the same seed. If
it drifts, something is randomising per call, which is
[the cheapest tampering check a detector has](audiocontext-fingerprinting.md).
2. **Sanity-check the pairing by hand.** Six channels should never appear beside a
latency that belongs to onboard stereo. If it does, you have found the exact
contradiction this section exists to prevent.
Compare the output to a stock Firefox on the same machine and you will see the shape of
the guarantee: the stock browser reports your real card, the seeded browser reports a
coherent invented one, and neither reports the round, hardware-free defaults a bare
container does. If you need a specific device rather than a seed-derived one,
[pinning a field](pinning.md) leaves the rest of the identity untouched.
## Conclusion
`sampleRate`, `outputLatency` and `maxChannelCount` are read straight from the OS audio
driver, which means a headless server has nothing truthful to say through them and a
careless spoof says something impossible. The buffer hash gets all the attention, but
these three static numbers are read first and cost nothing to check. Treating them as one
coherent device profile, reproducible from a seed, is what keeps a six-channel count from
ever sitting next to a laptop's latency, and that pairing is the thing a consistency check
is actually built to find.
## Short answers to the questions that lead here
**What is AudioContext.sampleRate and can I change it from JavaScript?** It is the rate
the audio device runs at, `44100` or `48000` Hz, read from the driver. Page JavaScript
cannot change it truthfully; only the engine underneath can decide what the read returns.
**Why does my headless server report the same audio values on every run?** Because there
is no sound hardware, so the context falls back to a fixed default. Identical values
across every container are a cohort, not a clean fingerprint.
**Is outputLatency a reliable fingerprinting signal?** On its own, weakly. In combination
with sample rate and channel count it is strong, because only certain triples correspond
to devices that actually exist.
**What does maxChannelCount reveal?** How many output channels the device can drive: 2 for
stereo, 6 for 5.1, 8 for 7.1. A value that contradicts the latency and rate is the tell.
**How do I make these values consistent with each other?** Do not draw them
independently. Pick a real device archetype and take all three from it, which is what a
seed-derived profile does automatically.
**Will an empty or suspended AudioContext pass a detector?** No. A blocked or suppressed
read is recorded as its own signal, so an absent value fails the same way a wrong one
does.
## Sources
- W3C Web Audio API specification, which defines `sampleRate`, `baseLatency` and
`outputLatency` on `AudioContext` and `maxChannelCount` on the destination node:
[www.w3.org/TR/webaudio/](https://www.w3.org/TR/webaudio/).
- MDN Web Docs on the same properties, read from the engine rather than from any single
detector's rendering of them:
[AudioContext.sampleRate](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/sampleRate),
[AudioContext.outputLatency](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/outputLatency),
and [AudioDestinationNode.maxChannelCount](https://developer.mozilla.org/en-US/docs/Web/API/AudioDestinationNode/maxChannelCount).
- This project's own audio patches and their release notes, which choose the three static
audio properties together as one coherent device profile so the values never contradict
each other.
**See also:** [AudioContext fingerprinting](audiocontext-fingerprinting.md) for the
rendered-buffer side of the same surface, [why getVoices() comes back empty](speech-synthesis-voices.md)
for the other operating-system read that gives a server away, and
[the checklist for being detected on one site](playwright-detected-as-bot.md) for where
the audio device sits in the order you should debug.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The audio device is one of
the machine tells no page-level plugin can reach, which is why it is solved in the engine.*
+148
View File
@@ -0,0 +1,148 @@
---
title: "Why automating login is riskier than reusing a session"
description: "Automating a login form runs the most monitored flow on most sites. Reusing a saved session skips it, if the fingerprint still matches the one that logged in."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 12
---
# Why automating login is riskier than reusing a session
**Automating a login form is riskier than reusing a session because the login form is
the single most heavily monitored flow on most sites, and reusing a saved session avoids
that flow entirely.** The catch is that a reused session only holds if the browser
fingerprint still matches the one that created it.
A script that fills a username, types a password and clicks submit looks like the
obvious way to get an automated session logged in. It is also, on most sites, the
single most heavily instrumented sequence of actions a visitor can perform - the exact
place account-takeover and credential-stuffing defenses concentrate, because that is
where they matter most for the site.
This page explains why that flow draws the most scrutiny, how session reuse skips it,
and the one condition - fingerprint consistency - that decides whether a reused session
keeps working.
## Automating the login form vs reusing a session: which is safer
Reusing a saved session is safer on most sites, because it never runs the login form -
the flow where abuse defenses are strongest - and instead starts already authenticated,
the way a returning visitor does. Automating the form can work, but it runs directly
into the site's most aggressive checks.
| | Automate the login form | Reuse a saved session |
|---|---|---|
| What runs | Username, password, submit: the most monitored flow | No login flow; the session starts authenticated |
| Scrutiny | Highest on the site | Same as any returning visitor |
| Main dependency | Human-like timing, focus order, pointer motion | Fingerprint matching the session's original |
| Fails when | Any automation signal is caught at the form | The fingerprint or exit country changes |
## Why the login flow specifically gets more scrutiny than the rest of the site
Most pages on a site are read by anyone. A login form is different: it is the one
place where getting it wrong has a direct cost to the operator, so it is where fraud
and abuse defenses get the most investment, updated the most often, and tuned the most
aggressively. A page that flags automation loosely everywhere else often flags it
tightly at the one form that asks for credentials.
That means every automation-detectable signal on this site - the timing between
keystrokes, whether the pointer travelled to the field or teleported, whether a field
was focused before it was filled, the rhythm between filling the form and submitting
it - gets checked hardest at exactly the moment a login script runs it.
## The alternative: don't run the flow at all
Playwright's [`storage_state`](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-storage-state)
captures cookies and local storage from a context and can load them into a new one.
Log in once, by hand or through a session you trust,
[save and reuse that state](save-reuse-login-storage-state-playwright.md), and every
subsequent automated session starts already authenticated - no username field, no
password field, no submit click, and none of the scrutiny attached to that specific
sequence.
```python
# once, from a session that actually logged in
context.storage_state(path="session.json")
# every run after that
context = browser.new_context(storage_state="session.json")
```
This is not a workaround. It is the same mechanism a real returning visitor uses:
nobody who logged into a site yesterday retypes their password today, they carry a
session cookie that says who they already are. An automated session doing the same
thing is not imitating unusual behaviour, it is doing what every session that isn't a
first-time login already does.
## The condition this depends on, and it is not optional
A session was created by a specific browser, on a specific machine, presenting a
specific fingerprint at the moment of login. Replaying that session's cookies from a
different fingerprint is asking a site to believe that the same identity suddenly
changed its GPU, its font list, its canvas output and its TLS handshake between one
request and the next - which is exactly the kind of cross-session inconsistency
[a detector is built to catch](timezone-proxy-mismatch.md), regardless of whether the
cookie itself is genuinely valid.
Sites that bind a session to more than a cookie - checking the fingerprint against
what was recorded at login, not just validating the token - will flag or invalidate a
replayed session on a mismatched machine even though the credential is real. The
cookie proves who logged in. It does not, on its own, prove the request came from the
same browser that did.
The practical requirement follows directly: the fingerprint has to stay the same
across the login and every session that reuses it. [A profile tied to one seed](persistent-profiles.md)
is what makes that possible - the identity that logged in and the identity replaying
the cookie later are the same one, not two that happen to share a token.
## What to actually do
1. **Log in once**, through a session using the exact identity - seed, profile, proxy
country - you intend to keep using.
2. **Save `storage_state` immediately after**, while the session is fresh.
3. **Reuse it from a context built with the same identity**, not a fresh or different
one. The cookie and the fingerprint are a pair; only one half being right is not
enough.
4. **Treat expiry as certain, not exceptional.** Sessions end. Build the re-login path
once, using the same identity, rather than improvising it the first time a saved
session stops working.
## Short answers to the questions that lead here
**Is it safe to automate a login form at all?** It works, and it is the highest-scrutiny
sequence on most sites. If a session can be captured and reused instead, that avoids
the scrutiny rather than trying to survive it.
**Does a valid session cookie guarantee I won't be flagged?** No. A cookie proves a
credential. Some sites separately check whether the fingerprint replaying it matches
the one that created it, and a mismatch there is checked independently of whether the
token itself is genuine.
**Can I use one saved session across different machines or proxies?** Not safely if
the fingerprint or exit country changes. The session and the identity that created it
are a pair for exactly the same reason [a proxy and a timezone have to agree](timezone-proxy-mismatch.md).
**What happens when the saved session expires?** The automation needs a real
re-authentication path, through the same identity that created the original session,
not a different one improvised under pressure.
**See also:** [Save and reuse login with storage_state in Playwright](save-reuse-login-storage-state-playwright.md),
for the practical capture-and-reuse steps;
[Playwright persistent profile: what it fixes and breaks](persistent-profiles.md), for
the identity half of this pairing;
[how to scrape data behind a login with Playwright](how-to-scrape-behind-login-playwright.md),
for the end-to-end flow; and
[human-like pointer motion](human-mouse-movement.md), for what the login flow itself
checks when there is no way to avoid running it.
## Sources
- Playwright's own [`storage_state` / `storageState`](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-storage-state)
API, for the session capture and reuse mechanism described above.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level, on why the safest login is usually the one that
never runs as automation at all.*
@@ -0,0 +1,227 @@
---
title: "Back a computer-use agent with a real browser engine"
description: "Run OpenAI's computer-use agent inside patched Firefox by implementing its Computer interface over an invisible_playwright page, and the honest limits."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 16
---
# Back a computer-use agent with a real browser engine
A computer-use agent is a loop: take a screenshot, send it to a model, get back a
coordinate to click or some text to type, apply it, screenshot again. The interesting
question for anyone running one against real sites is not the model. It is what browser
the screenshots come from and where the clicks land, because that is the part a site can
inspect.
The good news is that the popular reference implementation was built to let you swap that
part out. This page shows how, using the real invisible_playwright API, and it is honest
about what the swap fixes and what it leaves entirely up to you.
## The seam that makes this easy
OpenAI's open `cua-sample-app` does not hardcode a browser. The screenshot-and-click loop
drives a small, pluggable `Computer` interface, and the repository ships one
implementation of it called `LocalPlaywrightComputer`. Every action the model returns -
`screenshot`, `click`, `type`, `scroll`, `keypress`, `goto` - is a method the loop calls
on whatever `Computer` object you hand it. The loop does not know or care what is behind
those methods.
That seam is the whole opportunity. If you implement the same interface over a browser you
control, the same loop now runs inside your engine. Nothing about the agent's reasoning
changes. What changes is the thing on the other side of `screenshot()` and `click()`.
## What backing it with a real engine actually fixes
`LocalPlaywrightComputer` drives a stock automation build. invisible_playwright is a
Firefox patched at the C++ level and driven by stock Playwright, generating a full,
internally consistent identity per session - GPU, canvas, audio, fonts, screen, roughly
400 fields - from one seed. Point the `Computer` interface at one of its pages and two
concrete things move:
- **The engine the screenshots come from.** The pixels the model sees are rendered by a
browser whose fingerprint, TLS handshake and driver layer read as a genuine Firefox
rather than as an automation build announcing itself. This is why it clears most
fingerprint, TLS and driver-layer checks: it is built to look like a real browser
driven by a real person, not to suppress signals. A suppressed or blank surface is its
own tell, so the goal is a present, plausible value, not a missing one.
- **The page the clicks land on.** Coordinate clicks arrive on a page inside that engine,
and pointer motion between them follows a Bezier curve rather than teleporting from
point to point.
What it does not touch is equally important, and the next section is about that.
## Two lines to launch, one class to adapt
The launch is the same two-line change as anywhere else in these docs. `InvisiblePlaywright`
returns a real Playwright `Browser`, so every method you already use is available:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
page.mouse.click(200, 140) # the pointer arcs there on a Bezier curve
```
To feed that page to the agent, wrap it in a class that satisfies the `Computer`
interface. This is a representative subset of the methods the loop calls; each one is a
plain call on the real Playwright `page`:
```python
import base64
from invisible_playwright import InvisiblePlaywright
class InvisibleComputer:
"""Adapts an invisible_playwright page to cua-sample-app's Computer interface."""
environment = "browser"
dimensions = (1280, 800)
def __init__(self, page):
self._page = page
def screenshot(self) -> str:
png = self._page.screenshot()
return base64.b64encode(png).decode()
def click(self, x: int, y: int, button: str = "left") -> None:
self._page.mouse.click(x, y, button=button)
def type(self, text: str) -> None:
self._page.keyboard.type(text)
def keypress(self, keys: list[str]) -> None:
for key in keys:
self._page.keyboard.press(key)
def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None:
self._page.mouse.move(x, y)
self._page.mouse.wheel(scroll_x, scroll_y)
def goto(self, url: str) -> None:
self._page.goto(url)
def get_current_url(self) -> str:
return self._page.url
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
computer = InvisibleComputer(page)
# hand `computer` to the cua-sample-app Agent in place of LocalPlaywrightComputer;
# the screenshot-and-click loop now runs inside the patched Firefox.
```
Everything here uses only documented Playwright methods on a real `Browser` and `Page`.
There is no wrapped subset to learn, which is the point of the two-line switch. Pass a
`seed` and the identity is reproducible, so a run that gets challenged can be replayed
exactly instead of guessed at.
## What it does not fix, and who supplies that
Swapping the engine fixes the engine and the page. It does not change two things that
decide most real outcomes, and pretending otherwise would be dishonest.
- **The click rhythm.** The loop still clicks a coordinate, waits for the model, and
clicks the next coordinate. That cadence has a shape: long pauses clustered around model
latency rather than around reading speed, and clicks that land dead-centre on targets.
The Bezier motion between points helps, but the higher-level timing is the agent's, and
a site that watches behaviour rather than fingerprints is watching that. Human pacing is
something you add on top; see [the pause shaped like model latency](ai-browser-agents-stealth.md)
and [what human pointer motion actually looks like](human-mouse-movement.md).
- **The network path.** The screenshots come from a real-looking Firefox, but the traffic
still exits wherever your host or proxy sends it. A genuine browser on a datacenter
address, or on an IP a thousand other people are using this minute, still loses. IP
reputation, per-account quotas and rate limits are not browser properties, and no engine
swap touches them. You supply the clean exit.
Set a proxy the same way as any other session, and let the browser timezone follow the
exit rather than pinning it by hand:
```python
proxy = {"server": "socks5://gate.example.com:1080", "username": "u", "password": "p"}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
computer = InvisibleComputer(page)
...
```
The honest summary: this raises the browser and the page from "obvious automation" to
"indistinguishable from a real Firefox", which clears the fingerprint, TLS and driver
layer. It leaves behaviour timing and network reputation exactly where they were, on your
side of the line. See [why a clean fingerprint can still be blocked](why-blocked-with-a-clean-fingerprint.md)
for what remains after the engine stops being the problem.
## Prove the swap did what you think
Do not trust the diff, measure it. Run the agent's own `screenshot()` against a public
fingerprinting page, once with `LocalPlaywrightComputer` and once with the adapter above,
and compare the reports field by field rather than reading the verdicts. The fields that
move - GPU renderer, canvas hash, the driver flag, the platform string - are what the
swap bought you. The fields that do not move, and the timing and address it cannot touch,
are what you still owe. The method is the same one in
[how to test bot detection without a false pass](how-to-test-bot-detection.md): assert the
right signal is present, not that a wrong one is absent, and run it more than once.
## Conclusion
The pluggable `Computer` interface in OpenAI's `cua-sample-app` is the seam that lets you
run the exact same screenshot-and-click loop inside a different browser. Implementing it
over an invisible_playwright page fixes the two things a site inspects first - the engine
the screenshots come from and the page the clicks land on - and that is genuinely most of
the fingerprint battle. It is not the whole session. The coordinate-click rhythm and the
network path are still yours, and an agent that looks like a real Firefox on a bad IP with
robotic pacing is still an agent that gets caught. Swap the engine, then supply the pacing
and the exit.
## Short answers to the questions that lead here
**Can I use invisible_playwright with OpenAI's computer-use agent?** Yes. The
`cua-sample-app` drives a pluggable `Computer` interface; implement that interface over an
invisible_playwright page and the loop runs inside the patched Firefox.
**Does this make my agent undetectable?** No, and no tool honestly can. It makes the
browser engine, TLS and driver layer read as a real Firefox, which clears most
fingerprint checks. It does not fix your IP, your rate limits, or the timing of the clicks.
**What exactly does the engine swap change?** The screenshots are rendered by a real-looking
Firefox instead of an automation build, and the clicks land through Bezier pointer motion.
The higher-level click cadence and the network path are unchanged.
**Do I have to rewrite the agent's loop?** No. You implement one small adapter class with
methods like `screenshot`, `click`, `type` and `scroll`, each a plain call on the real
Playwright page. The loop stays as it is.
**Why does behaviour timing still matter?** Because a site can watch when you act, not just
what your browser reports. Pauses shaped like model latency and clicks dead-centre on
targets are a behavioural signal the engine does not touch.
**What proxy should I use?** A clean one. [Around 90% of proxies are already known and
blocked](configuration.md) before you ever use them, and a perfect browser on a known IP
still loses. Set it via the `proxy` argument and let the timezone auto-derive from the exit.
**See also:** [AI browser agents and stealth](ai-browser-agents-stealth.md) for what
applies across every agent framework, [how browser-use gets detected](browser-use-detection.md)
for the CDP-driven case, and [the checklist for being detected on one site](playwright-detected-as-bot.md)
for the order to debug in once something flags you.
## Sources
- OpenAI's open `cua-sample-app` and its `Computer` interface, including the shipped
`LocalPlaywrightComputer` implementation, read from the repository rather than assumed.
- This project's own API: `InvisiblePlaywright` returns a real Playwright `Browser`, so
the adapter above uses only documented Playwright methods - [`Page`](https://playwright.dev/python/docs/api/class-page),
[`Mouse`](https://playwright.dev/python/docs/api/class-mouse) and
[`Keyboard`](https://playwright.dev/python/docs/api/class-keyboard) - unchanged.
- This project's release gates and the field-by-field comparison method documented in the
testing pages linked above.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The engine swap is the easy
half; the pacing and the exit are the half that decides the session.*
+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="99" height="20" role="img" aria-label="Firefox: 151.0">
<title>Firefox: 151.0</title>
<linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient>
<clipPath id="r"><rect width="99" height="20" rx="3" fill="#fff"/></clipPath>
<g clip-path="url(#r)">
<rect width="56" height="20" fill="#555"/>
<rect x="56" width="43" height="20" fill="#FF7139"/>
<rect width="99" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
<text x="28.0" y="15" fill="#010101" fill-opacity=".3">Firefox</text>
<text x="28.0" y="14">Firefox</text>
<text x="77.5" y="15" fill="#010101" fill-opacity=".3">151.0</text>
<text x="77.5" y="14">151.0</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 855 B

+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="157" height="20" role="img" aria-label="browser launches: 1.64M">
<title>browser launches: 1.64M</title>
<linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient>
<clipPath id="r"><rect width="157" height="20" rx="3" fill="#fff"/></clipPath>
<g clip-path="url(#r)">
<rect width="116" height="20" fill="#555"/>
<rect x="116" width="41" height="20" fill="#007ec6"/>
<rect width="157" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
<text x="58.0" y="15" fill="#010101" fill-opacity=".3">browser launches</text>
<text x="58.0" y="14">browser launches</text>
<text x="136.5" y="15" fill="#010101" fill-opacity=".3">1.64M</text>
<text x="136.5" y="14">1.64M</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 898 B

+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="86" height="20" role="img" aria-label="License: MIT">
<title>License: MIT</title>
<linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient>
<clipPath id="r"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath>
<g clip-path="url(#r)">
<rect width="56" height="20" fill="#555"/>
<rect x="56" width="30" height="20" fill="#dfb317"/>
<rect width="86" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
<text x="28.0" y="15" fill="#010101" fill-opacity=".3">License</text>
<text x="28.0" y="14">License</text>
<text x="71.0" y="15" fill="#010101" fill-opacity=".3">MIT</text>
<text x="71.0" y="14">MIT</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 847 B

+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="159" height="20" role="img" aria-label="LinkedIn: Federico Elia">
<title>LinkedIn: Federico Elia</title>
<linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient>
<clipPath id="r"><rect width="159" height="20" rx="3" fill="#fff"/></clipPath>
<g clip-path="url(#r)">
<rect width="63" height="20" fill="#555"/>
<rect x="63" width="96" height="20" fill="#0A66C2"/>
<rect width="159" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
<text x="31.5" y="15" fill="#010101" fill-opacity=".3">LinkedIn</text>
<text x="31.5" y="14">LinkedIn</text>
<text x="111.0" y="15" fill="#010101" fill-opacity=".3">Federico Elia</text>
<text x="111.0" y="14">Federico Elia</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 896 B

+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="93" height="20" role="img" aria-label="python: 3.11+">
<title>python: 3.11+</title>
<linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient>
<clipPath id="r"><rect width="93" height="20" rx="3" fill="#fff"/></clipPath>
<g clip-path="url(#r)">
<rect width="50" height="20" fill="#555"/>
<rect x="50" width="43" height="20" fill="#007ec6"/>
<rect width="93" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
<text x="25.0" y="15" fill="#010101" fill-opacity=".3">python</text>
<text x="25.0" y="14">python</text>
<text x="71.5" y="15" fill="#010101" fill-opacity=".3">3.11+</text>
<text x="71.5" y="14">3.11+</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 851 B

+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="20" role="img" aria-label="Stars: 1.88k">
<title>Stars: 1.88k</title>
<linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient>
<clipPath id="r"><rect width="80" height="20" rx="3" fill="#fff"/></clipPath>
<g clip-path="url(#r)">
<rect width="43" height="20" fill="#555"/>
<rect x="43" width="37" height="20" fill="#e8a317"/>
<rect width="80" height="20" fill="url(#s)"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
<text x="21.5" y="15" fill="#010101" fill-opacity=".3">Stars</text>
<text x="21.5" y="14">Stars</text>
<text x="61.5" y="15" fill="#010101" fill-opacity=".3">1.88k</text>
<text x="61.5" y="14">1.88k</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 847 B

+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="204" height="38" viewBox="0 0 204 38" role="img" aria-label="Join on Telegram">
<title>Join on Telegram</title>
<defs>
<linearGradient id="g" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#37AEE2"/>
<stop offset="1" stop-color="#1E96C8"/>
</linearGradient>
</defs>
<rect x="0.5" y="0.5" width="203" height="37" rx="18.5" fill="url(#g)"/>
<g transform="translate(20 9.5)" fill="#fff">
<path d="M18.6 1.1 1.2 7.9c-1.0.4-1.0.9-.2 1.2l4.4 1.4 1.7 5.2c.2.6.4.7.9.3l2.5-2.0 4.2 3.1c.8.4 1.3.2 1.5-.7l2.7-12.7c.2-1.0-.4-1.5-1.3-1.1Zm-4.0 3.1-7.3 6.6-.3 3.1-1.5-4.6 9.1-5.1Z"/>
</g>
<text x="123" y="24.5" fill="#fff" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="15" font-weight="600">Join on Telegram</text>
</svg>

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

+202
View File
@@ -0,0 +1,202 @@
---
title: "Battery API fingerprint: does Firefox expose it?"
description: "Does desktop Firefox expose the Battery Status API? No, it was removed in 2017, so a battery object under a Firefox user agent gives away a fake browser."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 29
---
# Battery API fingerprint: does Firefox expose it?
Short version: on the desktop, no. Firefox removed the
[Battery Status API](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API)'s
`navigator.getBattery()` from web content in the 52 series back in 2017, on privacy
grounds, and it has never come back.
So a real desktop Firefox has no Battery Status API at all. `navigator.getBattery` is
`undefined`, and there is nothing to read.
That single fact turns the Battery API into a small but reliable consistency check. A
page that claims to be Firefox in its user agent, and then successfully obtains a
battery object, has not measured your battery. It has caught a browser that is lying
about what it is. This page explains why that happens, why the honest answer is to have
no Battery API rather than a convincing fake one, and how a genuine Firefox build gets
that for free.
## What the Battery Status API was, and why Firefox dropped it
The Battery Status API let a page call `navigator.getBattery()` and read the charge
level, whether the device was plugged in, and the seconds until full or empty. It was
meant for power-aware pages that could defer heavy work on a low battery.
The privacy problem showed up quickly. The charge level was reported with enough
precision, and it changed slowly enough, that the combination of level plus
charging state plus time-remaining behaved like a short-lived identifier: two page
loads seconds apart saw the same unusual value, and that value could be used to correlate
visitors even across contexts that were supposed to be isolated. Firefox responded by
removing the API from web content entirely in the
[52 series in 2017](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/52),
restricting it to chrome/privileged code only. Chromium kept a
reduced version. That divergence is the whole point for fingerprinting: the presence or
absence of `getBattery` is now a per-engine trait, not a per-device one.
## Why absence is the honest answer, and a fake battery is the tell
A fake battery reading is the riskier of the two outcomes, because an absence matches
every real Firefox automatically while a fake value has to survive every angle a
detector can check it from. There are two ways an automation stack can end up
"consistent" with a Firefox user agent on this surface.
The first is to actually be a Firefox build, in which case `navigator.getBattery` is
simply not there, because the engine never defined it. Nothing is spoofed. There is no
value to keep plausible over time, no charging animation to fake, no drain rate to model.
The gap in the API is real, so it survives every probe automatically.
The second is to run an engine that does expose the Battery API, usually a Chromium base,
and then bolt on a JavaScript layer that tries to look like Firefox. Now the stealth
layer has a decision to make. If it leaves `getBattery` in place, the page reads a battery
object from a claimed-Firefox browser, which no real Firefox produces, and that is a
direct contradiction.
If it deletes `getBattery` to hide the mismatch, it has to delete it
convincingly: the property has to be gone from the prototype, absent from a
`for..in` walk, missing from `Object.getOwnPropertyNames`, and it has to stay missing when
a detector fetches a clean copy of `Navigator.prototype` from a fresh iframe and compares.
A partial delete that patches the obvious access but leaves a trace elsewhere is worse than
leaving the API alone, because now there is both a Firefox user agent and evidence of
tampering. This is the pattern CreepJS is built to catch: it does not ask what you report,
it asks whether the shape of your environment is internally consistent and whether anything
looks deleted.
The general rule, which the Battery API illustrates cleanly, is that adding a fake signal
is almost always more dangerous than a real absence. An absence is one bit that matches
every other Firefox on earth. A fake is a value you now have to defend against every angle
a detector can approach it from.
## How the patched build inherits the gap natively
invisible_playwright drives a Firefox that is patched at the C++ level, not a different
engine wearing a Firefox user agent. Because the base is a real Firefox from the current
release line, it inherits the same missing Battery API that every stock desktop Firefox
has had since 2017. There is no shim reintroducing `getBattery` and no shim removing it,
because there was never anything to remove. The surface is correct for the same reason a
stock Firefox is correct: the engine simply does not implement that API for web content.
That is the recurring theme across the fingerprint surface. A field is most robust when it
is genuinely produced by a real browser rather than reconstructed on top of one. The same
logic covers the identity fields that a page reads far more often than the battery, such
as [what `navigator.vendor` and `navigator.productSub` report on Firefox](navigator-vendor-productsub-firefox.md),
which are wrong on a Chromium base pretending to be Firefox and correct on an actual
Firefox build.
## Check it yourself in two lines
Switching from stock Playwright is a two-line change, and after that every standard
Playwright method works unchanged. Here is the whole probe: launch, open a page, and ask
the browser whether it has a Battery API.
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
report = page.evaluate("""() => ({
userAgent: navigator.userAgent,
hasGetBattery: typeof navigator.getBattery,
onPrototype: 'getBattery' in Navigator.prototype,
})""")
print(report)
```
On this build you get a Firefox user agent, `hasGetBattery` equal to `"undefined"`, and
`onPrototype` equal to `False`. That is the correct, boring result: a Firefox with no
Battery API, exactly like the one a person runs. The `seed=42` argument makes the whole
identity reproducible, so if you are comparing this against a stock Firefox on the same
machine you can rerun the exact same fingerprint rather than a fresh random one each time.
The comparison is the part worth doing by hand. Open the same probe in a stock desktop
Firefox and you will see the identical three values. Open it in a plain Chromium and
`hasGetBattery` comes back `"function"`. That contrast, run against a real reference
browser rather than read as a verdict, is the method the
[testing guide](how-to-test-bot-detection.md) argues for on every surface.
## What a passing battery check does not buy you
This is where honesty matters, because it is easy to overread a green result.
Having no Battery API, correctly, tells a detector that this browser looks like a genuine
Firefox on this one narrow surface. It says nothing whatsoever about your network. The
Battery API cannot see your IP address, your exit country, or how many requests you have
made in the last minute. A browser can be a flawless Firefox on every fingerprint field
and still be turned away because the exit IP is a known datacenter range, because the
account behind the session hit a per-account quota, because the requests arrived faster
than a human hands could produce them, or because the pointer never moved before the click.
invisible_playwright is designed to look like a real browser driven by a real person, and
that is genuinely why it passes most fingerprint, TLS and driver-layer checks: the engine
is a real Firefox, so the traits it reports are the traits Firefox actually has, this API
absence among them. But it does not supply a clean IP, it does not pace your actions, and
it does not manage per-account limits. Those are yours to bring: a reputable exit, human
timing, and sane volume. The [configuration guide](configuration.md) covers the proxy and
timezone side of that, and the [detected-on-one-site checklist](playwright-detected-as-bot.md)
walks the causes in the order they are usually the real culprit, with the network exit near
the bottom of the list rather than the top.
## Conclusion
The Battery Status API is a clean example of a detection signal that is best handled by not
existing. Desktop Firefox removed it in 2017, so the honest state for anything claiming to
be Firefox is to have no `getBattery` at all. A stealth layer that adds a fake battery
object to a non-Firefox engine creates the exact contradiction it was trying to avoid, and
one that tries to delete the API instead has to delete it perfectly or leave a tampering
trace. A patched real-Firefox build sidesteps the whole dilemma by inheriting the gap
natively. It is a small surface, it costs nothing to get right, and getting it right is
worth exactly as much as it is: one consistent bit, and not one bit more about your IP or
your behaviour.
## Short answers to the questions that lead here
**Does Firefox have a Battery API?** Not on the desktop for web content. It was removed in
the 52 series in 2017 for privacy reasons, so `navigator.getBattery` is `undefined`.
**Is a battery reading under a Firefox user agent a red flag?** Yes. A real desktop Firefox
cannot return a battery object, so a page that gets one from a claimed-Firefox browser has
caught a fake.
**Does Chrome still expose it?** Chromium kept a reduced Battery API, which is why the
presence or absence of `getBattery` now works as a per-engine trait rather than a
per-device one.
**Should a stealth tool fake a battery to look complete?** No. Adding a fake signal is more
dangerous than a real absence, because the fake has to survive every angle a detector can
probe from, while an absence matches every other Firefox automatically.
**Does invisible_playwright spoof the Battery API?** No. It drives a real patched Firefox,
so the API is simply absent the same way it is absent in a stock Firefox. There is nothing
to spoof.
**If my battery check passes, am I undetectable?** No. This surface says nothing about your
IP reputation, per-account quotas, rate limits, or behaviour. A clean proxy and human pacing
are still on you.
## Sources
- Mozilla's own [Firefox 52 release notes](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/52),
which record the Battery Status API becoming available only to chrome/privileged code
in that release, 2017.
- This project's own fingerprint parity checks, which read `navigator.getBattery` against a
stock desktop Firefox and confirm both report the same absence.
**See also:** [what data websites collect about your browser](what-data-websites-collect-about-your-browser.md),
[the navigator.vendor and productSub story on Firefox](navigator-vendor-productsub-firefox.md),
and [how navigator.webdriver actually reads](navigator-webdriver-explained.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The most robust fingerprint
field is the one a real browser genuinely produces, and sometimes the one it genuinely does
not.*
+187
View File
@@ -0,0 +1,187 @@
---
title: "BFCache and pageshow.persisted under browser automation"
description: "Automation disables the back/forward cache, so pageshow.persisted is always false and every Back is a full reload. Why sites notice, and what enabling it costs."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 13
---
# BFCache and pageshow.persisted under browser automation
**Under browser automation, `pageshow.persisted` is almost always `false`, because the
drivers switch the
[back/forward cache](https://developer.mozilla.org/en-US/docs/Glossary/bfcache) off.**
Every back navigation becomes a full reload
instead of an instant restore, and a page that pays attention to the difference is
looking at a browser that behaves unlike every consumer browser of the last decade.
Press Back in a real browser and the previous page usually comes back instantly,
restored from memory with its JavaScript state intact. The page is told about it: a
`pageshow` event fires with `persisted` set to `true`. Under automation that almost never
happens.
This page covers what the cache does, what automation does to it, why the difference is
visible, what turning it back on breaks in your own tests, and how to decide.
## What the back/forward cache actually does
When you navigate away, the browser can keep the whole page in memory rather than
discarding it: the DOM, the JavaScript heap, the scroll position, the state of your
variables. Navigate back and it is restored rather than rebuilt.
The page finds out through the
[`pageshow`](https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event) event:
```js
window.addEventListener('pageshow', (e) => {
console.log('restored from bfcache:', e.persisted);
});
window.addEventListener('pagehide', (e) => {
console.log('kept in bfcache:', e.persisted);
});
```
`persisted` is `true` on a restore and `false` on an ordinary load. It is a single
boolean, available to any script, and it is normally used for legitimate purposes such as
re-running analytics on a restored view.
## What automation does to it
Automation switches the cache off deliberately, in both major engines, so it never
restores a page. Two different situations, both ending in the same place.
**Firefox under Playwright.** The driver that Playwright uses to control Firefox sets
`disallowBFCache` on every docshell it manages. That is a deliberate choice on its part:
a cached page makes automation less predictable, because state survives navigations that
a test expects to reset.
**Chromium under automation.** The cache is generally not in play either, and there is a
long-standing question on the Playwright tracker about how to enable it at all.
The result is the same in both: `event.persisted` is `false` on every navigation, always,
in a browser where a real user would frequently see `true`.
## Why a page can notice
The difference is not subtle once you look for it, and none of it needs a fingerprinting
library.
**The event itself.** A session that navigates back and forth several times and reports
`persisted: false` every single time describes a browser with the cache disabled.
Disabling it is not something ordinary users do.
**The timing.** A restore is immediate because nothing is rebuilt. A reload fetches,
parses and executes. A page that measures how long its own initialisation took on a back
navigation sees two very different numbers.
**The side effects of a reload.** Scripts run again, timers restart, counters reset,
analytics fire a fresh page view. A page holding in-memory state watches it vanish on
every back navigation, which is behaviour it can compare against what it expects.
None of this is a strong standalone signal. It belongs to the same family as
[the pointer that teleports](human-mouse-movement.md): one more way in which the session
does not behave like a person's browser, cheap to check and rarely thought about.
## How this project handles it, and what it costs you
The behaviour here is inverted relative to the stock driver: the cache is **left enabled
by default**, so a back navigation restores the page and `persisted` comes back `true`,
which is what a real Firefox does. The old behaviour is available behind a preference for
anyone who needs it.
The cost is real and you should know it before you enable this anywhere:
**[`go_back()`](https://playwright.dev/python/docs/api/class-page#page-go-back) waiting
for `load` can time out.** A bfcache restore does not fire `load`,
because nothing loaded. Code that navigates back and waits for that event will sit there
until the timeout expires.
```python
# fragile once bfcache is enabled
page.go_back() # may wait for a load that never comes
# robust either way
page.go_back(wait_until="domcontentloaded")
page.wait_for_selector("#something-on-the-previous-page")
```
Waiting for something you can see is more robust than
[waiting for a lifecycle event](how-to-wait-for-page-load-playwright.md) anyway, and it
works whether or not the page was restored.
**State survives navigation.** That is the point of the cache, and it is also the thing
that makes a test suite non-deterministic if the suite assumed a fresh page. If your
tests depend on state being reset by going back, they were depending on the automation
behaving unlike a browser.
## Deciding which behaviour you want
The two cases genuinely differ and it is worth being explicit rather than picking a
default:
- **A test suite against your own application.** Predictability is worth more than
realism, nothing is watching, and a cache that preserves state between steps causes
flakiness. Disabling it is reasonable.
- **A session that needs to look like a person's browsing.** Realism wins, and the cost
is writing navigation waits that do not depend on `load`.
The mistake is not choosing either one. It is not knowing which you have, and then being
surprised by a timeout or by a signal.
## Conclusion
The back/forward cache is a small thing that automation turns off for good engineering
reasons, and turning it off produces a browser whose back button behaves differently from
every consumer browser.
The fix is not complicated. Leave the cache on and stop waiting for `load` after a back
navigation. The second half is what actually costs effort, and it is the reason the stock
drivers made the other choice.
## Short answers to the questions that lead here
**What does `event.persisted` mean?** That the page was restored from the back/forward
cache rather than loaded again.
**Why is `persisted` always false in Playwright?** Because the driver disables the cache,
in Firefox explicitly and in Chromium effectively.
**Can a site detect that bfcache is disabled?** It can observe that back navigations
never restore, which is not how consumer browsers behave. It is a weak signal on its own
and it belongs to a family of weak behavioural signals.
**Why does `go_back()` hang after I enable bfcache?** Because a restore does not fire
`load`. Wait for `domcontentloaded` or for an element instead.
**Should I enable it?** For realistic sessions yes, for deterministic test suites
probably not.
**Does bfcache leak state between pages?** It preserves state within a page across
navigation, which is its purpose. There is an open Playwright issue about globals
appearing to leak between pages because of it, which is worth reading if you see
something odd.
**See also:** [human-like mouse movement](human-mouse-movement.md), the same category of
behavioural difference, and
[the checklist for being detected on one site](playwright-detected-as-bot.md), where
behaviour is step five, and [how websites detect bots](how-do-websites-detect-bots.md)
for where behavioural signals sit in the wider picture.
## Sources
- [MDN: the back/forward cache (bfcache)](https://developer.mozilla.org/en-US/docs/Glossary/bfcache)
and [MDN: the `pageshow` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event),
which documents `persisted`.
- Playwright's documented [`go_back()`](https://playwright.dev/python/docs/api/class-page#page-go-back)
and its `wait_until` values, including `domcontentloaded`.
- The Playwright tracker's open items on bfcache behaviour and on enabling it under
Chromium.
- This project's driver, which reads a preference before disabling the cache and leaves
it enabled by default, with the `go_back` caveat recorded alongside it.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. The preference exists because the timeout described
above is real, and a test suite that hits it deserves a way back to the old behaviour.*
+261
View File
@@ -0,0 +1,261 @@
---
title: "WebDriver BiDi vs CDP: does the new protocol hide you"
description: "WebDriver BiDi standardizes the automation control wire across browsers, but the leaks that expose automation live in the page, not on the protocol you speak."
parent: "Comparisons"
nav_order: 19
---
# WebDriver BiDi vs CDP: does the new protocol hide you
There is a hope, repeated often enough that it is worth answering directly, that
WebDriver BiDi is the fix for automation detection. The reasoning goes: the old
Chrome DevTools Protocol had a famous leak, everyone is moving to a standardized
bidirectional protocol, so the standardized one must close it.
It does not, and the reason is the useful part. The leak people are trying to
escape was never on the protocol wire. It is in the page. Changing which wire the
driver speaks over leaves the page-level artifacts exactly where they were.
## The protocol is the control channel, not the fingerprint
The protocol is the wire a driver speaks over, not the fingerprint a page reads,
so changing it moves nothing a detector looks at. CDP, BiDi and Firefox's own
Juggler are all
control channels: the out-of-process link a driver uses to say "open a page", "go
to this URL", "evaluate this script", "give me the console messages". They are
plumbing between your Python process and the browser process.
A detection script running inside the page cannot see that channel at all. It
cannot see whether the command that opened the tab arrived as CDP JSON, as a BiDi
message, or as a Juggler call. What it can see is whatever the browser does to the
page as a side effect of being driven: a property that reads differently, a global
that should not exist, a built-in prototype that was touched before the first
script ran, a loop that runs measurably slower because the engine is in a
different mode.
So the question "does BiDi hide me" is really two questions that get conflated. Is
the control channel itself observable? Mostly no, for any of the three. Does
switching the control channel change the in-page artifacts? Also no, because those
artifacts are produced by a different mechanism entirely.
## What CDP's Runtime.enable leak actually was
The CDP `Runtime.enable` leak was a page-visible side effect of how Chromium
automation manages JavaScript execution contexts, not a property of the CDP wire
itself. It is narrower than the folklore around it, so it is worth stating
exactly.
On Chromium, automation libraries call the CDP command `Runtime.enable` to manage
the execution contexts they need for evaluating JavaScript. That call has an
in-page side effect: it causes the browser to emit context-creation events, and a
page can provoke and observe the timing of that machinery. Ordinary browsing never
triggers it, so its footprint reads as automation. Two separate projects,
[Patchright](vs-patchright.md) and
[rebrowser-patches](vs-rebrowser-patches.md), independently converged on the same
fix: stop calling `Runtime.enable` automatically and create the needed contexts by
hand, with identifiers the page cannot correlate back to the session.
Notice what that fix is and is not. It is not "switch protocols". It is a change to
how the driver uses the protocol so that the observable side effect stops
happening in the page. The leak lived in the page; the fix lives at the driver.
The protocol name never entered into it.
## Firefox automation here rides Juggler out of band
This project does not patch that leak because it never had it. The Firefox we ship
is driven by stock Playwright over Juggler, an out-of-band control protocol that is
not CDP and has no `Runtime.enable` command to call. There is no automatic
context-enable step whose in-page timing a script can measure, because that step is
a CDP-shaped thing and this is not CDP.
That is an architecture difference, not a cleverness difference. The
`Runtime.enable` timing signal is specific to how CDP-driven Chromium manages
execution contexts. A driver that manages contexts differently, over a different
channel, does not emit that particular event and so cannot be caught by a probe
looking for it. The class of Chromium hand-patches that exist to suppress it has no
counterpart here for the same reason a Linux binary has no Windows registry to
clean.
```python
from invisible_playwright import InvisiblePlaywright
# A stock Playwright script. The control channel underneath is Juggler,
# not CDP, so there is no Runtime.enable side effect for a page to time.
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# standard Playwright: the returned object is a real Browser
print(page.title())
```
None of that code mentions the protocol, which is the point: the wire is an
implementation detail of the driver, and the same script would work if it changed.
## What WebDriver BiDi standardizes, and what it leaves untouched
WebDriver BiDi is a genuinely good thing and worth being precise about. It is a
[W3C effort](https://www.w3.org/TR/webdriver-bidi/) to give every browser one
bidirectional automation protocol, so that a driver can subscribe to events and
issue commands the same way across engines, instead of CDP on one family and
something bespoke on another. Firefox, Chromium and others implement it.
Playwright itself has been building BiDi support. If you have ever wanted "one
protocol, every browser", this is that.
What it standardizes is the shape of the control channel: the commands, the
events, the subscription model. What it does not do, because it is not what a
control protocol is for, is change what the browser exposes to the page. BiDi has
no clause that turns off [`navigator.webdriver`](does-playwright-set-navigator-webdriver.md), no clause about whether a helper
runs in the page's realm before the page's own scripts, no clause about whether the
JavaScript engine is in a mode that runs loops slower. Those are engine and driver
behaviors. A standardized wire carries them just as faithfully as a proprietary one.
The mental model that trips people up is that CDP and BiDi are alternatives on the
same axis as "detected" and "not detected". They are not. Protocol choice and
detectability are orthogonal. You can be trivially detectable over BiDi and hard to
detect over Juggler, or the reverse, and the protocol name predicts neither.
## The leaks that survive any protocol change
If the wire is not where the tells are, where are they? Two families, both in the
page, both indifferent to which control channel drove the browser.
The first is execution-context timing. Attaching a driver to the JavaScript engine
can put realms into a debug-adjacent mode where the optimizing JIT is off and slow
paths run on every call, and that is measurable from the page as time, with no
property to read. It is
[why a fingerprinting service can report developer tools with none open](debugger-timing-detection.md).
Whether the driver spoke CDP, BiDi or Juggler to attach makes no difference to the
resulting distribution; what matters is whether the engine was left in that mode.
This project's fix was to attach without entering debug mode at all, so the JIT
stays on. That is an engine change, and it would be exactly as necessary under BiDi.
The second is injected globals and touched built-ins. If a driver runs a helper in
the page's own realm before the page loads, and that helper touches `JSON`,
`Date.prototype` or `Array.prototype`, then the page starts life with built-ins
that something else handled first, and that is observable. In a controlled
experiment that was the difference between a session being blocked and not. The fix
is to never touch the page realm until the page's own first script has run. Again:
a driver behavior, carried identically over any wire. A page reading a leftover
global does not know or care how the global got injected.
There is also a separate, wire-adjacent failure mode worth naming so it is not
confused with the above: the driver and browser can drift out of agreement about
the protocol's own field set, which
[breaks the client rather than exposing it to the page](playwright-protocol-drift.md).
That is a maintenance surface every automation stack has, standardized protocol or
not, and it is orthogonal to detection too.
## How to choose, and what to actually measure
The practical upshot is that "which protocol" is not a stealth decision. Pick the
protocol for engineering reasons: BiDi for cross-browser uniformity and a stable
standard, CDP where you need a Chromium-specific capability it exposes, Juggler if
you are on this project's Firefox because that is what it speaks. The three differ
on engineering properties, but not on the axis people ask about here:
| Protocol | Cross-browser standard | `Runtime.enable`-style context leak | Control wire visible to the page | Protocol choice changes detectability |
|---|---|---|---|---|
| CDP | No (Chromium family) | Yes, until hand-patched at the driver | No | No |
| WebDriver BiDi | Yes (W3C, multi-engine) | No such standardized clause | No | No |
| Juggler | No (Firefox, this project) | No `Runtime.enable` command exists | No | No |
Then measure the
things that actually decide detection, none of which the protocol choice sets.
The measurement that separates the real question from the imagined one is timing
and page state against a stock browser on the same machine, not a protocol audit:
```python
from invisible_playwright import InvisiblePlaywright
PROBE = """
() => {
// 1. any global that a normal browser would not have?
const suspects = Object.getOwnPropertyNames(window)
.filter(n => /puppet|driver|automation|cdc_|selenium/i.test(n));
// 2. rough JIT-sanity number; compare the RATIO to a stock browser
const t = performance.now();
for (let i = 0; i < 5e6; i++) Math.sqrt(i);
const loopMs = performance.now() - t;
// 3. did anything claim a user gesture nobody made?
const ua = navigator.userActivation || {};
return { suspects, loopMs, isActive: ua.isActive, webdriver: navigator.webdriver };
}
"""
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
print(page.evaluate(PROBE))
```
Run the same probe in a stock browser and diff the results. The absolute loop
number means nothing on its own; the ratio between the two browsers is the JIT
signal. A non-empty `suspects` list is an injected-global leak. `webdriver` should
read as it does on a clean browser. Every one of those is a page-level property,
and every one of them would report the same value whether the tab was opened over
CDP, BiDi or Juggler.
## Conclusion
WebDriver BiDi is worth adopting for what it is: one standard control protocol
across browsers, which is a real convenience and a real cleanup. It is not a
stealth upgrade, because it operates on the wrong axis. The `Runtime.enable` leak
that made CDP notorious was a page-visible side effect of how one protocol managed
contexts, fixed at the driver, not by changing wires. The leaks that remain,
execution-context timing and injected globals, live in the page and the engine, and
a standardized wire carries them as faithfully as a proprietary one. This project's
Firefox never had the CDP leak because it does not speak CDP, and it closes the
in-page leaks in the engine and driver, which is the layer where they actually are.
Choose the protocol for engineering reasons and measure detection where it lives.
## Short answers to the questions that lead here
**Does switching from CDP to WebDriver BiDi make me undetectable?** No. The
protocol is the control channel; the tells that flag automation are in the page and
the engine, and they read the same over any wire.
**Was the CDP Runtime.enable leak a protocol problem?** It was a page-visible side
effect of how CDP-driven Chromium managed execution contexts. The fix changes how
the driver uses the protocol, not which protocol it is.
**Does this project have the Runtime.enable leak?** No. Its Firefox is driven over
Juggler out of band, which has no `Runtime.enable` command, so the signal that
several Chromium projects hand-patch never exists here to begin with.
**Is WebDriver BiDi bad, then?** Not at all. It is a solid cross-browser standard
worth adopting for uniformity and stability. It just is not a detection fix,
because detectability and protocol choice are orthogonal.
**What actually gives automation away if not the protocol?** Execution-context
timing when the engine is left in a debug-adjacent mode, globals or touched
built-in prototypes injected into the page realm, and behavior. All page-level or
engine-level, none of them on the wire.
**How do I test my own setup?** Run a timing-and-globals probe in your automated
browser and in a stock browser on the same machine, and diff them. The ratio, not
the protocol name, is the signal.
## Sources
- This project's own debugger and execution-context fixes, described in
[why an attached debugger makes automation detectable](debugger-timing-detection.md),
for the in-page timing and injected-global leaks that survive a protocol change.
- The [Patchright](vs-patchright.md) and [rebrowser-patches](vs-rebrowser-patches.md)
comparisons on this site, read from each project's own repository, for what the
CDP `Runtime.enable` fix is and is not.
- The [WebDriver BiDi specification](https://www.w3.org/TR/webdriver-bidi/)'s own
scope, for what a standardized control protocol standardizes and what it leaves
to the engine.
**See also:** [why an attached debugger makes automation detectable](debugger-timing-detection.md)
for the page-level leaks in detail, [invisible_playwright vs rebrowser-patches](vs-rebrowser-patches.md)
for the CDP fix arrived at twice, and [how to test whether your browser is detected](how-to-test-bot-detection.md)
for the compare-against-stock method this page leans on.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The protocol under
the driver is an implementation detail; the leaks were never on the wire.*
@@ -0,0 +1,223 @@
---
title: "Block images to speed up scraping (and when not to)"
description: "Blocking images, fonts and media with route.abort() cuts bandwidth and wall-clock time, but a no-image waterfall is itself a tell. When to use it and when not to."
parent: "Scraping with Playwright"
grand_parent: "Guides"
nav_order: 92
---
# Block images to speed up scraping (and when not to)
Aborting image, font and media requests is one of the biggest speed wins available to a
Playwright scraper, and it is two lines of code. It is also, on the wrong page, a clean
way to get yourself noticed. A browser that fetches HTML and JavaScript and never a
single image produces a request pattern no human session shows.
So this is not a pure win, and that is the reason it gets its own page. Blocking
resources is the right call for internal test runs and for bulk data pulls where transfer
cost dominates. It is the wrong call on exactly the sessions you most want to look human.
This page covers what it saves, the two lines that do it, the tell it creates, and where
the line between the two cases falls.
## What blocking resources actually saves
On most pages the HTML and the JavaScript are a small fraction of the bytes. Images,
web fonts and any autoplaying media are the rest, and on an image-heavy listing page
they are the large majority of the transfer. If your scraper only reads text, prices or
structured data out of the DOM, every one of those bytes is downloaded and thrown away.
Aborting them changes two things you can measure:
- **Bandwidth.** On an image-heavy page the transfer routinely drops from a few megabytes
to a few hundred kilobytes. Over tens of thousands of pages that is the difference
between a proxy bill you notice and one you do not.
- **Wall-clock time.** The page reaches its "loaded" state sooner because it is no longer
waiting on the slowest large assets, and `page.goto` returns earlier. The saving is
largest on pages that block rendering on fonts or lazy-load a wall of images.
The mechanic is stock Playwright, and it works identically under invisible_playwright:
the wrapper returns a real Playwright `Browser`, so [`page.route` and `route.abort`](https://playwright.dev/python/docs/network#abort-requests)
behave exactly as documented upstream. There is no special API to learn.
## The two lines that do it
Register a route handler, abort the resource types you do not need, and continue
everything else. The launch is the usual two-line switch from stock Playwright.
```python
from invisible_playwright import InvisiblePlaywright
# resource types that are pure weight for a text/data scrape
BLOCK = {"image", "media", "font"}
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.route(
"**/*",
lambda route: route.abort()
if route.request.resource_type in BLOCK
else route.continue_(),
)
page.goto("https://example.com")
print(page.title())
```
The async form is the same shape:
```python
from invisible_playwright.async_api import InvisiblePlaywright
BLOCK = {"image", "media", "font"}
async with InvisiblePlaywright(seed=42) as browser:
page = await browser.new_page()
async def router(route):
if route.request.resource_type in BLOCK:
await route.abort()
else:
await route.continue_()
await page.route("**/*", router)
await page.goto("https://example.com")
print(await page.title())
```
Two notes that save time later. Register the route **before** `goto`, or the first
navigation's assets are already in flight before the handler exists. And keep
`stylesheet` out of the block set unless you have checked the page: some layouts compute
element positions from CSS, and dropping it can move the very nodes your selectors point
at. `image`, `media` and `font` are the safe core; add `stylesheet` only after you
confirm the DOM you read still resolves.
## The tell: a request waterfall no human produces
A real person's browser loads images, fetches the fonts the page asks for, and pulls the
tracking pixel and the hero media without being told twice - and a scraper that refuses
all three produces a request waterfall no human session shows. That is the honest
caveat, and it is the whole reason this page is not just "block everything, go faster".
The network waterfall of a genuine session has a characteristic shape: a burst of mixed
resource types, images arriving late and out of order, fonts blocking early paint. A
session that fetches the HTML document and a handful of scripts and then goes silent has
none of that shape. It is a request pattern that belongs to a scraper and to almost
nothing else.
This is not a fingerprint that the engine can spoof. invisible_playwright is built to
look like a real browser driven by a real person, and that is why it passes most
detection: the [fingerprint, the TLS handshake and the driver layer read as a genuine
Firefox](does-playwright-support-firefox-stealth.md). But *which requests you choose to
make* is your behaviour, not the browser's identity. If your code refuses every image on
a page a human would load, you have hand-built a behavioural tell that no stealth layer
touches, the same category as a pointer that teleports or a form filled in eighty
milliseconds. The [checklist for being flagged on one site](playwright-detected-as-bot.md)
puts behaviour above the proxy for exactly this reason.
So the block set is a decision about the session, not a global optimisation you turn on
once and forget.
## Where to block, and where not to
Split your work into two buckets and treat them differently.
**Block resources freely when load does not need to look human:**
- **Internal test runs and CI.** You are checking your own selectors and your own
extraction, not passing anyone's inspection. Speed is the only axis that matters.
- **Bulk data pulls where transfer cost dominates** and the endpoint is not scoring you,
for example a site you have permission to crawl, an API-backed page, a
[sitemap walk](how-to-scrape-a-sitemap-playwright.md) over thousands of URLs where the
proxy bill is the real constraint.
**Leave images loading when the session needs to look human:**
- **The first visit to a page that is clearly scoring the session**, or any flow that
starts behind a challenge. The seconds you save are not worth the waterfall shape.
- **Anything interactive that a human would look at.** If the run
[scrolls, clicks and reads](human-mouse-movement.md), it should also be pulling the
images a reader would see.
A middle path exists and is often the right one: block the heaviest single type only.
Dropping `media` and web `font` requests while still loading `image` keeps most of the
human waterfall shape and still cuts real weight, because autoplaying video and large
font files are frequently the worst offenders. Measure your own pages before deciding the
block set is worth the tell.
## What this does not fix
Blocking resources is a speed and cost lever. It is not a stealth lever, and on its own
it changes none of the things that actually decide whether a session gets through.
- **IP reputation.** A [datacenter or already-flagged
exit](can-websites-detect-a-datacenter-proxy-ip.md) is visible before the first byte of
HTML, and no route rule touches it. Supply a clean proxy yourself.
- **Per-account quotas and rate limits.** Fetching fewer bytes per page does not raise a
cap. If anything, going faster lets you hit it sooner, so pair aggressive blocking with
[deliberate pacing](how-to-rate-limit-your-scraper-playwright.md).
- **Behaviour and timing.** The waterfall shape above is one behavioural signal; pointer
motion, dwell time and request cadence are others, and they are your responsibility, not
the engine's.
invisible_playwright makes the browser read as a real Firefox. The clean proxy and the
human pacing are the parts you bring. Blocking images speeds up the run; it does not move
any of these three.
## Conclusion
`route.abort()` on `image`, `media` and `font` is a large, cheap speed and bandwidth win,
and it works identically under invisible_playwright because the wrapper hands you a real
Playwright browser. The catch is that a no-image request waterfall is a behavioural tell,
so scope it: block freely on test runs and bulk pulls where load is the constraint, and
leave images loading on the sessions you most want to read as human. When in doubt, block
the heaviest type only and measure, rather than switching everything off and hoping the
shape goes unnoticed.
## Short answers to the questions that lead here
**Does blocking images make Playwright faster?** Yes, often substantially, because images,
fonts and media are usually the bulk of a page's bytes and a text scrape throws all of
them away. Wall-clock time drops because the page stops waiting on the slowest assets.
**How do I block images in Playwright?** Register a `page.route("**/*", ...)` handler
before `goto` and call `route.abort()` when `route.request.resource_type` is `image`,
`media` or `font`, and `route.continue_()` otherwise.
**Does blocking images get me detected?** It can. A session that fetches HTML and scripts
but never an image produces a request waterfall no human session shows. That is a
behavioural tell, separate from your fingerprint, and no stealth layer hides it.
**Should I also block CSS and JavaScript?** Usually not. Many pages compute layout and
render content from CSS and JavaScript, so blocking them can move or remove the nodes your
selectors read. Start with `image`, `media` and `font` only.
**Will this make invisible_playwright undetectable?** No, and nothing does. It makes the
browser read as a real Firefox, which is most of the battle, but IP reputation, account
quotas, rate limits and timing are yours to handle with a clean proxy and human pacing.
**When should I not block images?** On the first visit to a page that is clearly scoring
the session, and on any interactive flow a human would actually look at. There, looking
human is worth more than the seconds you save.
## Sources
- Playwright's [request interception API](https://playwright.dev/python/docs/network#abort-requests)
(`page.route`, `route.abort`, `route.continue_` and
[`request.resource_type`](https://playwright.dev/python/docs/api/class-request#request-resource-type)),
read from its own documentation rather than a rendered example.
- This project's own measurements of per-page transfer on image-heavy pages, where images,
fonts and media are consistently the majority of the bytes.
- The behavioural-tell reasoning in this project's detection notes, where request shape is
treated as behaviour rather than fingerprint.
**See also:** [pulling images down on purpose when you do want them](how-to-download-images-in-bulk-playwright.md),
[the checklist for being detected on one site](playwright-detected-as-bot.md), and
[testing bot detection without a false pass](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The speed is stock
Playwright; the tell is the part the speed guides leave out.*
+147
View File
@@ -0,0 +1,147 @@
---
title: "What BotD actually detects, and what it does not"
description: "What BotD's twenty detectors actually check, read from its own source: mostly whether a browser is telling the truth about which engine it is, not automation."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 3
---
# What BotD actually detects, and what it does not
BotD is the open-source bot detector from the FingerprintJS team. It is small, it is
readable, and reading it changes how you think about this problem, because most of
its twenty detectors are not looking for automation at all.
They are checking whether your browser is telling the truth about **which browser it
is**.
Read from source on 2026-07-27 (`fingerprintjs/BotD`, `src/detectors/`).
## The twenty detectors
```
app_version distinctive_properties document_element_keys
error_trace eval_length function_bind
languages_inconsistency mime_types_consistence notification_permissions
plugins_array plugins_inconsistency process
product_sub rtt user_agent
webdriver webgl window_external
window_size
```
Exactly one of those, [`webdriver`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver),
is the check everybody knows. A handful look for
specific named tools. The rest are engine identity and internal consistency.
| Detector group | The question it asks | Examples named here |
|---|---|---|
| The one everyone knows | Is the automation flag set? | `webdriver` |
| Engine identity | Does the browser behave like the engine its user agent claims? | `eval_length`, `product_sub`, `error_trace`, `window_external` |
| Internal consistency | Do two views of the same fact agree, and does a real machine and window exist? | `languages_inconsistency`, `mime_types_consistence`, `plugins_inconsistency`, `rtt`, `window_size` |
## The interesting group: what engine are you really?
Some values are decided by the JavaScript engine and cannot be changed from
JavaScript without being obvious. BotD reads them, works out which engine you must
be, and compares that against what your user agent claims.
**`eval_length`.** `eval.toString().length` is a fixed number per engine, the same
category of leak as [any other native function's own source](tostring-native-code-detection.md).
The check is literally: if the length is 37 and the engine kind is not WebKit or Gecko,
that is a bot. A Chromium build claiming to be Firefox fails here on a value nobody thinks
to spoof.
**`product_sub`.** If the browser claims to be Chrome, Safari, Opera or WeChat, then
[`navigator.productSub`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/productSub)
must be `20030107`. Firefox reports `20100101`. One
comparison, no ambiguity ([why a real Firefox reports `20100101`](navigator-vendor-productsub-firefox.md)).
**`error_trace`.** Stack traces are formatted differently by different engines, and
the detector matches the string for known tool signatures, PhantomJS among them.
**`function_bind`**, **`window_external`**, **`app_version`**: the same idea on other
surfaces. `window_external` matches `window.external.toString()` against a known
commercial crawler's signature.
None of these are secret. They are just values a spoofing layer does not think about,
because they are not on the list of "things bots are known for".
## The second group: does your story hold together?
This group never asks whether a value is unusual. It asks whether two values that
must agree actually do, and whether a real machine and window are behind them.
**`languages_inconsistency`**, **`mime_types_consistence`**,
**`plugins_inconsistency`**: the same fact asked in two ways, with the answers
compared. Not "is this value unusual" but "do these two agree".
**`rtt`**, **`window_size`**: values a real machine and a real window have, and a
container often does not.
**`document_element_keys`** and **`distinctive_properties`**: attributes and globals
that specific automation tools leave behind, which is the closest BotD gets to
looking for bots directly.
## What this means if you are on the other side
Three things follow: spoofing a user agent alone tends to make a browser easier to
detect rather than harder, being a genuine instance of the engine you claim passes
this whole detector class for free, and the risk BotD does not touch moves to other
signals entirely. They are the same three that turn up everywhere in this area.
**[Spoofing a user agent alone is worse than not spoofing it](is-changing-user-agent-enough.md).** Change the string and
you have to change `productSub`, `eval.toString().length`, the stack-trace format,
`window.external`, and the plugin and MIME arrays to match, or you have created the
exact contradiction BotD is built to find. Most user-agent spoofing makes a browser
easier to detect, not harder.
**Being a real instance of what you claim passes this whole class for free.** A real
Firefox reporting Firefox has the right `productSub`, the right `eval` length, the
right stack format and the right plugin array, because they are not claims, they are
the engine. There is nothing to keep consistent because nothing was changed.
**The remaining risk moves elsewhere.** Passing every one of these twenty says
nothing about whether [your GPU string is plausible](webgl-renderer-strings.md), your
fonts match your platform, or [your timezone agrees with your IP](timezone-proxy-mismatch.md).
Those are the ones that decide modern outcomes and BotD does not look at them.
## Checking your own
BotD is on npm and takes about four lines to run. Do it on the machine that will do
the work instead of your laptop, and read which detectors fired rather than the
verdict.
If any of the engine-identity group fires, stop and fix that first: it means the
browser you are presenting is not the browser you are running, and no amount of work
on the other surfaces compensates for that.
## Short answers to the questions that lead here
**What is BotD?** The open-source bot detector from the FingerprintJS team. It runs in
the page and returns a verdict rather than a fingerprint.
**Is BotD the same as FingerprintJS?** No. FingerprintJS
[identifies a visitor across sessions](fingerprintjs-visitor-id.md). BotD answers a
different question: is this automation.
**Why does most of it not look like bot detection?** Because most detectors check which
browser engine you really are, by testing behaviours that differ between engines. A
browser claiming one engine and behaving like another is the finding.
**Can I pass it by setting `navigator.webdriver` to undefined?** No. That is
[one detector out of roughly twenty](navigator-webdriver-explained.md).
**Does passing BotD mean I am undetected?** It means one open-source detector found
nothing. Commercial systems combine far more, including things no in-page script can
see.
**See also:** [what sannysoft checks](sannysoft-explained.md), which is the older
list of the same kind, and [how CreepJS detects tampering](creepjs-explained.md),
which takes the consistency idea considerably further.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright).
We gate every release on BotD, so the detector names and the compared values above
come out of its source and not out of memory.*
+159
View File
@@ -0,0 +1,159 @@
---
title: "Browser extensions are a fingerprint surface"
description: "An installed browser extension is a fingerprint surface a page can detect three ways. How sites find extensions, and why a stealth extension backfires."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 12
---
# Browser extensions are a fingerprint surface
Yes, a website can detect an installed browser extension, and it can do so three
separate ways: by probing the resources the extension exposes, by watching what it
changes on the page, and by spotting the traces its API overrides leave behind. So an
extension is not just a feature you add. It is another
[fingerprint surface](what-is-a-browser-fingerprint.md), and the most common reason
people add one is to hide a fingerprint, which is where this gets circular.
Adding an extension to an automated browser feels like adding a feature. It is also
adding something a page can look for, and the sections below cover each of the three
detection paths, when an extension is safe to run, and how to load one into a Firefox
profile if you decide to.
## The three ways a page finds an extension
**[Web-accessible resources](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/web_accessible_resources).**
An extension that exposes files to pages does so at a URL containing its own
identifier. Fetch that URL and see whether it loads.
```js
fetch('moz-extension://<id>/<file>') // resolves only if that extension is here
```
The identifier differs per browser and, in Firefox, per profile, which limits the
scan. It does not eliminate it, because extensions that need page access often need
predictable resources.
**What it does to the page.** An ad blocker removes elements, so a page can insert a
bait element with a name matching a common filter list and check whether it survived.
A style-injecting extension changes computed values. Anything that modifies the DOM
leaves the modification behind, and the modification is the detection.
**The behaviour it adds.** An extension that patches `navigator` or the canvas has to
run before the page, and it leaves the same traces as any other page-level override:
own properties where prototypes are expected, getters that are not native,
[a `toString` that prints your source](tostring-native-code-detection.md).
## Why a stealth extension is usually the wrong shape
A stealth extension on top of a stealth engine usually makes you easier to detect, not
harder, because two components deciding the same values contradict each other. This is
worth stating plainly, because it is the most common reason someone asks how to load
one.
A stealth extension operates at the page layer. It runs inside the document, it is
made of JavaScript, and everything on
[the three levels page](playwright-stealth-levels.md) about that layer applies to it. It
also has to run before the page's own scripts, which is a race it does not always win.
And if the browser already sets those values in its engine, the extension is now a
second opinion arguing with the first. Two components deciding what `navigator` says do
not average out; they disagree, and the disagreement is easier to spot than either
answer alone. That is the same argument as
[turning off a crawler's own fingerprint generator](playwright-detected-as-bot.md).
So: extensions for functionality, yes. Extensions for stealth on top of a stealth
engine, no.
## Extensions that are fine, and how to think about the rest
Ask what the extension does to the page:
- **Nothing visible to the page.** A tab manager, something that only touches its own
UI. Effectively invisible.
- **Changes what the page sees.** Blockers, style injectors, script managers. Findable,
and worth knowing that ad blockers are extremely common on real browsers, so their
presence is not by itself unusual. Their *absence* is more unusual than people
assume.
- **Rewrites browser APIs.** The fingerprinting-protection kind. These are the ones
that create the arguing-with-the-engine problem.
The second point deserves emphasis, because it cuts against the instinct. A very large
share of real browsers run an ad blocker. A profile that carries none is not
suspicious on its own, but it is one more small way in which a fresh automated profile
differs from a used personal one, alongside
[having no cookies](recaptcha-v3-score.md).
## How to load one, if you decide to
There is no extension argument in this wrapper. What there is is a
[persistent profile](persistent-profiles.md), and an extension installed into that
profile stays there:
```python
with InvisiblePlaywright(seed=42, profile_dir="/path/to/profile") as browser:
...
```
Launch once with that path, install the `.xpi` the normal way through the browser's own
add-ons page, then reuse the directory. Without `profile_dir`, every session builds a
fresh profile from the seed, which is exactly why an extension installed in one run is
gone in the next.
Pair a stable profile with a [stable seed](reproducible-agent-browser-identity-seed.md).
A profile that accumulates cookies and
storage while the hardware it claims changes every launch is a session whose history
and machine disagree about how long it has existed.
## Checking what yours is exposing
```js
// does a known resource resolve?
fetch('moz-extension://<id>/manifest.json').then(r => console.log('present', r.status))
.catch(() => console.log('not found'));
// did something remove my bait element?
const bait = document.createElement('div');
bait.className = 'ad-banner ads adsbox';
bait.style.height = '10px';
document.body.appendChild(bait);
setTimeout(() => console.log('blocked:', bait.offsetHeight === 0), 100);
```
Then run the same checks with no extensions loaded and compare. Anything that differs
is what the extension is telling the page about you.
## Short answers to the questions that lead here
**Can websites detect browser extensions?** Yes, through web-accessible resources,
through what the extension does to the page, and through the traces any API override
leaves.
**Does using an ad blocker make me more detectable?** It makes you findable, not
unusual. Ad blockers are very common on real browsers.
**Should I use a stealth extension with a stealth browser?** No. Two layers deciding
the same values contradict each other, and the contradiction is a stronger signal than
either.
**How do I add an extension in Playwright with Firefox?** Through a persistent profile:
install it once into that profile, then reuse the directory.
**Why does my extension disappear between runs?** Because a fresh profile is generated
each launch unless you pass a persistent one.
**Are extension IDs the same everywhere?** In Firefox they are typically per-profile,
which limits blind scanning. Do not rely on that as protection; extensions that need
page access tend to expose predictable resources anyway.
**See also:** [Function.prototype.toString and the native code check](tostring-native-code-detection.md),
which is what a page-level extension runs into, and
[three ways to make Playwright undetected](playwright-stealth-levels.md), for why the
layer an extension lives at has a ceiling.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. This page exists because someone asked in our
discussions and got an answer about a different kind of extension entirely.*
+262
View File
@@ -0,0 +1,262 @@
---
title: "Browser trust scores explained: what the number means"
description: "CreepJS trust, FingerprintJS confidence and reCAPTCHA v3 score measure different things: what each trust score means and why one green does not imply the rest."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 8
---
# Browser trust scores explained: what the number means
CreepJS trust, FingerprintJS confidence and a reCAPTCHA v3 score all look like the
same kind of number, and they are not: one counts contradictions, one measures how
sure a match is, and one estimates behavioural risk. A high number from one says
almost nothing about what the next one will read, and treating them as interchangeable
is the single most common misreading behind "I pass one test and fail the next".
This page separates the three numbers people conflate, says what each one is actually
counting, and shows why passing one implies nothing about the others. Then it shows
how to read all three from one reproducible session so you can stop guessing which
number moved.
## Three numbers, three different questions
The three numbers answer three unrelated questions: CreepJS trust asks whether your
values contradict each other, a FingerprintJS visitor ID asks whether you are the same
visitor as last time, and a reCAPTCHA v3 score asks how risky your behaviour and history
look. Line them up and the confusion evaporates:
- **CreepJS trust** is a consistency and lie count. It is high when nothing you report
contradicts anything else you report and nothing looks tampered with. It is not a
rarity score, and being unusual does not lower it.
- **A FingerprintJS visitor ID** is a hash, and the thing next to it labelled
**confidence** is a separate number that says how sure the library is that this ID
belongs to the same visitor as before. It is about linkability, not about looking
automated.
- **A reCAPTCHA v3 score** is a risk estimate between 0.0 and 1.0, built mostly from
behaviour and reputation rather than from what the DOM reports at all.
| Number | The question it answers | What it reads | What moves it |
|---|---|---|---|
| CreepJS trust | Do my reported values contradict each other? | Descriptors, prototypes, stack traces, canvas and font surfaces | A patched or blocked probe, or two fields that disagree |
| FingerprintJS visitor ID (+ confidence) | Am I the same visitor as before? | A hash of the browser's components, in a fixed order | Any one component changing changes the whole ID |
| reCAPTCHA v3 score | How risky do my behaviour and history look? | Interaction, cookies, storage and exit reputation, not the DOM | A warmed-up profile and realistic behaviour, not a cleaner fingerprint |
Different inputs, different outputs, different failure modes. The rest of this page is
one section per number, then why they do not move together.
## CreepJS trust: a lie count, not a rarity score
[CreepJS records a blocked probe as a lie](creepjs-explained.md) and walks
descriptors, prototypes and stack traces looking for values that were patched after
the fact. Its trust figure goes up when the surfaces agree with each other and down
when one of them looks edited or refuses to answer.
The part people get wrong: rarity does not enter into it. An identity that no other
machine on earth shares can score perfectly, as long as every field is internally
coherent. Conversely, the most common machine in the world scores badly the moment two
of its fields disagree, because a lie is a contradiction and a contradiction is what
this tool counts.
So the way to raise this number is not to look average. It is to be consistent: one
platform reported everywhere, a canvas that hashes the same twice in a row, a font
list that belongs to the operating system you claim. That is a property of how the
identity is generated, not a value you can paste in.
## The FingerprintJS visitor ID and its separate confidence
[A FingerprintJS visitor ID is a hash of its components](fingerprintjs-visitor-id.md),
around forty-one of them, serialised in a fixed order. There is no partial match:
change one component and the whole ID changes as if everything had. That is why the
same identity gives you the same ID and a different identity gives you a completely
different one, with nothing in between.
The `confidence` sitting beside the ID is a different number entirely. It does not tell
you whether you look automated. It tells you how reliable the library thinks this
particular match is, based on how stable the components it collected tend to be. You
can have a low-confidence ID on a perfectly clean browser and a high-confidence ID on a
browser that is obviously a bot. The two numbers are answering "who is this" and "how
sure am I", and neither is answering "is this a robot".
If your goal is to be recognised again, you want this ID stable. If your goal is to not
be recognised, you want it to change. Either way, it is orthogonal to the trust number
above.
## The reCAPTCHA v3 score: behaviour and history, not the DOM
reCAPTCHA v3 hands the site a number between 0.0 and 1.0, and
[a fresh browser tends to score low on reCAPTCHA v3](recaptcha-v3-score.md) even when
every fingerprint check it faces comes back clean. The reason is that this score is
largely about history and behaviour, and a brand new profile has neither.
An empty profile is a browser that has never been anywhere: no cookies, no consent
decisions, no storage, no prior interaction. There are far more automated sessions that
look like that than human ones, and the score reflects that base rate rather than any
DOM property you did or did not spoof. Perfecting your canvas hash does not move a
number that was never reading your canvas.
This is the honest caveat the other two numbers do not carry: a stable, consistent,
non-lying fingerprint is necessary and not sufficient here. It removes the reasons to
distrust you; it does not manufacture the past you do not have. That part is warmed-up
profiles, realistic behaviour and a reputable exit, none of which a fingerprint layer
can supply.
## Why passing one says nothing about the others
The three numbers are independent, so a high score on one predicts nothing about the
other two. Put them side by side and the independence is obvious:
- You can score high on CreepJS trust and low on reCAPTCHA v3, because a perfectly
consistent browser with no history is exactly what a consistent bot also looks like.
- You can have a stable, high-confidence FingerprintJS ID and still fail CreepJS,
because a stable ID only means your components did not move, not that they are
telling the truth.
- You can pass reCAPTCHA v3 on a warmed profile and fail CreepJS, because behavioural
reputation says nothing about whether a descriptor was patched.
They cross-cut. Each of the [four detector deep-dives in this set](how-to-test-bot-detection.md)
measures a different axis, and a green on one axis is not a green on the others. The
practical rule is to name which number you are looking at before you react to it,
because the fix for a low CreepJS trust (consistency) is not the fix for a low
reCAPTCHA v3 score (history), and applying one to the other wastes days.
## A blocked probe lowers the score, it does not hide from it
One instinct makes all three numbers worse at once: suppressing a signal. Blocking
canvas, returning an empty font list, refusing WebRTC, randomising a value per call so
nothing can pin it.
Every one of those is counted against you, not for you:
- CreepJS records a blocked probe as a lie by name, so blocking lowers trust directly.
- A value that changes on every read is a tampering tell, and a per-call-changing
canvas or audio hash reads as randomisation rather than a real device.
- A missing signal is still a signal. An empty result where a real browser has data is
itself the anomaly.
The consistency that raises a trust number is the opposite of hiding. This is why a
seed-derived identity, where every surface is drawn from one seed and stays put, scores
better than any suppression strategy: it answers every probe with a coherent value
instead of a refusal.
## Measure all three from one seeded session
The way to stop guessing which number moved is to make the identity reproducible, so a
change in a score is a change you made rather than a change in the draw. The wrapper is
stock Playwright with a seeded fingerprint, so the `browser` you get back is a real
Playwright `Browser` and every method is the one you already know:
```python
from invisible_playwright import InvisiblePlaywright
def read_canvas(page):
return page.evaluate("""() => {
const c = document.createElement('canvas');
const ctx = c.getContext('2d');
ctx.textBaseline = 'top';
ctx.font = '14px Arial';
ctx.fillText('trust-score-probe', 2, 2);
return c.toDataURL();
}""")
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
first = read_canvas(page)
second = read_canvas(page)
assert first == second # stable within a session, so not a per-call tell
```
Reading the same value twice in one session is the cheapest consistency check there
is: if `first` and `second` disagree, something is randomising per call, which is the
exact tampering pattern that costs you CreepJS trust. Here they match, which is the
behaviour you want.
Now confirm it is stable across sessions too, which is what keeps a FingerprintJS ID
where you put it, and what a consistency check rewards:
```python
def canvas_for_seed(seed):
with InvisiblePlaywright(seed=seed) as browser:
page = browser.new_page()
page.goto("https://example.com")
return read_canvas(page)
a = canvas_for_seed(42)
b = canvas_for_seed(42) # same seed, relaunched
c = canvas_for_seed(7) # a different identity
assert a == b # same seed reproduces the same machine
assert a != c # a different seed is a different, still-consistent machine
```
Measured this way, the same seed reproduces byte-identical canvas output run after run,
and a different seed produces a different value that is itself internally consistent.
That reproducibility is what lets you attribute a score change to the one thing you
changed. If you have not passed a seed, log `sf.seed` from the instance first so a run
that scored interestingly can be replayed exactly.
The honest boundary, again: this makes the CreepJS-style consistency axis and the
FingerprintJS linkability axis controllable and repeatable. It does not warm up a
profile, and the reCAPTCHA v3 number will still start low on a session with no past no
matter how clean the fingerprint is.
## Conclusion
Three numbers, three axes. CreepJS trust counts contradictions and lies, a
FingerprintJS ID and its confidence measure whether you are the same visitor as before,
and a reCAPTCHA v3 score estimates risk from behaviour and history. Passing one is not
passing another, suppressing a signal lowers all three rather than hiding from any of
them, and the only way to tell which number your last change actually moved is to hold
the identity still with a seed and compare. Name the axis before you react to the
number, and the contradictory results stop being contradictory.
## Short answers to the questions that lead here
**Is a CreepJS trust score the same as a reCAPTCHA score?** No. CreepJS trust counts
internal contradictions and tampering; a reCAPTCHA v3 score is a 0.0 to 1.0 risk
estimate built mostly from behaviour and history. A high one does not predict the
other.
**What does the FingerprintJS confidence number mean?** How sure the library is that
this visitor ID matches the same visitor as before. It is about the reliability of the
match, not about whether the browser looks automated.
**I pass CreepJS but still get a low reCAPTCHA score, why?** Because reCAPTCHA v3 is
mostly reading history and behaviour, and a fresh profile has neither. A clean
fingerprint removes reasons to distrust you; it does not supply a past.
**Does a rare fingerprint lower my trust score?** No. CreepJS trust is about
consistency, not rarity. An unusual but coherent identity can score perfectly; a common
but contradictory one scores badly.
**Does blocking canvas or fonts raise my score?** It lowers it. A blocked probe is
recorded as a lie, and a value that changes per read is a tampering tell. Answering
every probe with a coherent value scores better than refusing.
**Which score should I optimise for?** The one your target actually uses. Optimise
consistency for a CreepJS-style check, a warmed profile and realistic behaviour for a
reCAPTCHA-style score, and decide whether you want the FingerprintJS ID to stay put or
change.
## Sources
- The three detectors named above, each with its own page in this set, read from their
own source rather than from a rendered verdict: CreepJS on tampering, FingerprintJS on
the hashed visitor ID and its confidence, and reCAPTCHA v3 on the behavioural score.
- This project's own reproducibility measurements: identical seed reproduces
byte-identical canvas output within and across sessions, which is the property a
consistency check rewards.
**See also:** [how CreepJS decides you are lying](creepjs-explained.md) for the
consistency axis, [why a fresh browser scores low on reCAPTCHA v3](recaptcha-v3-score.md)
for the history axis, and [how to test whether your browser is detected](how-to-test-bot-detection.md)
for the compare-against-a-stock-browser method that keeps these numbers honest.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The three numbers on this
page get conflated because they all look like a percentage; none of them are the same
percentage.*
+190
View File
@@ -0,0 +1,190 @@
---
title: "browser-use gets detected: what you can and cannot change"
description: "browser-use drives Chrome over CDP. What BrowserProfile lets you change, what stays out of reach on a server, and the timing tell specific to AI agents."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 2
---
# browser-use gets detected: what you can and cannot change
If your browser-use agent works locally and gets challenge pages on a server, the
problem is usually not the agent and not the prompt. It is the browser it drives and the
machine it runs on, and only some of that is reachable from configuration.
This page is what `BrowserProfile` actually exposes, what those settings fix, what stays
out of reach, the signal that is specific to agent-driven sessions, and the honest answer
about swapping in a different engine.
## What browser-use gives you to change
browser-use's `BrowserProfile` lets you change six things: which browser binary
launches, its channel, a persistent profile directory, proxy, headless mode, and extra
command-line arguments. Everything else about the browser and the machine it runs on is
out of its reach. These fields are read from `browser_use/browser/profile.py`, the
configuration surface:
| Field | What it does |
|---|---|
| `executable_path` | which browser binary to launch |
| `channel` | a Chromium channel |
| `user_data_dir` | a persistent profile directory |
| `proxy` | proxy settings for the session |
| `headless` | headless or headed |
| `args` | extra command-line arguments |
That is a real set of levers, and three of them matter more than people use them for.
### executable_path, and what it expects
`executable_path` exists, and it expects a **Chromium-family** browser. The surrounding
code in `browser_use/browser/chrome.py` is entirely Chrome logic: finding a Chrome
executable, deriving the Chrome user-data directory from it, enumerating Chrome profiles.
The channel type is a Chromium channel.
The practical use of that field is pointing at your **real installed Chrome** rather
than the bundled Chromium. [Those are not the same browser](chromium-is-not-chrome.md):
the codec set differs, the branding differs, and a real Chrome install is a far more
common thing to be than a bundled test build.
### user_data_dir, which is underused
Pointing this at a profile that has genuinely been used is the single highest-value
change available in the configuration, because it is the only one that addresses history
rather than hardware.
An agent session starting from an empty profile is a browser that has never been
anywhere, which is
[most of why a fresh browser scores badly](recaptcha-v3-score.md). The traps that come
with persistent profiles are covered separately in
[what a persistent profile fixes and breaks](persistent-profiles.md), and the pairing
rule there applies here too.
## What configuration cannot reach
Everything about the machine. None of the fields above changes any of these, and on a
server all of them are true at once:
- **No GPU**, so WebGL reports a software renderer.
[What those strings mean](webgl-renderer-strings.md).
- **A container font set** that does not match the claimed platform.
[Why installing more is not the fix](headless-fonts-differ.md).
- **No audio device**, so the audio values fall back to defaults.
[The seven values](audiocontext-fingerprinting.md).
- **A screen with no taskbar** and a default resolution.
[The relationships that have to hold](screen-size-headless-tells.md).
- **Codec support** that describes a slim build rather than a desktop install, including
whether decoding is hardware accelerated.
[Three surfaces in one API](codec-fingerprinting.md).
- **A TLS handshake** decided before any of this by the network stack.
[Which no page-level layer can touch](ja3-ja4-tls-fingerprint.md).
This is why "it works on my laptop and not in Docker" is the most common shape of the
problem. The agent is identical; the machine is not.
[The container version of this list](playwright-docker-detection.md) goes through it in
order.
## The tell that is specific to agent-driven sessions
The tell specific to agent-driven sessions is timing, not fingerprint: an agent pauses to
think between actions, and those pauses cluster around model latency in a shape that human
reading never produces. This part does not apply to ordinary scraping and does apply to
browser-use.
An agent thinks between actions. It reads the page, calls a model, waits for a response,
then acts. That produces
[an interaction rhythm with a very particular shape](ai-agent-timing-signal.md):
- **Long, similar pauses before each action**, clustered around model latency rather than
around reading speed.
- **No movement during the pause.** A person reading a page moves the pointer, scrolls
slightly, drifts. An agent's pointer is perfectly still for two seconds and then
arrives exactly on a button.
- **Actions that land dead centre** on their targets, because coordinates come from the
accessibility tree rather than from a hand.
- **No wasted actions.** People scroll past things, hover over what they do not click,
and change their minds.
None of that is fixed by a stealth setting, and it is worth knowing because it explains
blocks that arrive **after** a few interactions rather than at the first page load. That
timing is the diagnostic:
[a block at first load points at the fingerprint or the address, a block after an
interaction points at behaviour](playwright-detected-as-bot.md).
## Can I use a stealth-patched Firefox with browser-use?
No, and it is better to say so plainly than to publish a workaround that does not work.
browser-use drives its browser over the Chrome DevTools Protocol, with Chrome-specific
arguments and Chrome profile handling. A Firefox binary in `executable_path` is not a
drop-in: the driver would be speaking a protocol the browser does not implement.
If you specifically want an engine whose fingerprint is set in its own source, the route
that works for agents is a different driver. Microsoft's
[`playwright-mcp`](https://playwright.dev/docs/getting-started-mcp) accepts a browser
and an executable path and speaks MCP, so an agent framework that talks MCP can drive a
patched Firefox through it.
[That integration is written up here](integrations/playwright-mcp.md).
That is a genuine trade: you give up browser-use's agent loop and get an engine-level
fingerprint. Which one matters depends on whether your blocks are arriving because of the
browser or because of the behaviour, and the timing test above tells you which.
## Conclusion
browser-use exposes enough configuration to fix the two things configuration can fix:
which browser binary runs, and whether the profile has a past. Point it at a real Chrome
and at a profile that has been used, and you have taken the available wins.
Everything else divides into two piles. The machine-level tells are shared with every
other automation tool and are fixed by changing the machine or the engine, neither of
which is a browser-use setting. The agent-rhythm tells are specific to this class of tool
and are not fixed by any fingerprint work at all.
Knowing which pile you are in takes one experiment: note whether the block arrives at the
first request or after a few actions.
## Short answers to the questions that lead here
**Why does my browser-use agent get blocked on a server but not locally?** Because the
server has no GPU, few fonts, no audio device and a default screen, and the agent is
identical in both places.
**Can I set a custom browser in browser-use?** Yes, `executable_path` in
`BrowserProfile`, and it expects a Chromium-family browser. Pointing it at your real
Chrome rather than the bundled Chromium is worth doing.
**Can I use a stealth Firefox with browser-use?** No. It drives over CDP, which Firefox
does not implement in the way the driver expects.
**Does a persistent profile help?** Yes, more than most settings, because it is the only
one that addresses having no history. Read the traps first.
**Why do blocks arrive after a few actions rather than immediately?** That usually points
at behaviour rather than fingerprint, and agent pacing has a recognisable shape.
**Does adding a proxy fix it?** It changes where you come from. If the browser is
announcing a datacenter through its GPU and fonts, the address was not the problem.
**See also:** [the checklist for being detected on one site](playwright-detected-as-bot.md),
which is the order to work in,
[Playwright in Docker](playwright-docker-detection.md), for the server case, and
[Playwright MCP](integrations/playwright-mcp.md), for the agent route that does accept a
different engine.
## Sources
- `browser_use/browser/profile.py`, which defines the configuration fields listed above,
and `browser_use/browser/chrome.py`, which is the Chrome executable and profile
handling. Read 2026-07-27.
- [Playwright's own MCP documentation](https://playwright.dev/docs/getting-started-mcp),
which lists `firefox` among the supported `--browser` values, confirming that route
(unlike browser-use) is not Chromium-only. Read 2026-08-06.
- The machine-level surfaces are each documented on their own page, linked above.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. This page says our engine does not fit browser-use,
because it does not, and a guide claiming otherwise would waste your afternoon.*
+244
View File
@@ -0,0 +1,244 @@
---
title: "BrowserLeaks canvas and WebGL hash, explained"
description: "The BrowserLeaks canvas and WebGL signature is a hash of a pixel readback, not your GPU. What it measures, and why one seed gives a byte-identical hash."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 6
---
# BrowserLeaks canvas and WebGL hash, explained
The BrowserLeaks canvas and WebGL signature is a hash of the pixels a readback call
returns, not a fingerprint of your GPU. It sits at the very end of the render pipeline,
which is why editing a reported renderer string never moves it, and why the only way to
control it is to control the bytes handed back at the readback boundary. Get that boundary
right and one seed produces a byte-identical hash on Windows and Linux alike.
BrowserLeaks shows you a canvas "signature" and a WebGL "signature" and treats each as a
stable identifier for your machine (see [what each BrowserLeaks panel tests](browserleaks-explained.md)
for the wider tour). People read those short hex strings as a fingerprint
of the GPU, and then try to change the GPU to change them. That is the wrong layer. The
signature is a hash of one specific thing, and once you know which thing, the whole
surface reads differently.
This page is what the signature measures, where in the pipeline it is actually taken, what
has to be true for two machines to produce the same one, and how to read both values
yourself against a stock browser.
## What BrowserLeaks calls a signature
The canvas test draws text and shapes into an off-screen canvas, then asks the page to
read the resulting pixels back out and hashes them. The WebGL test does the same with a
rendered 3D scene. In both cases the "signature" you see is the hash of the pixel bytes,
not of any property you can enumerate.
That distinction matters because the pixel bytes are the product of a long chain: the
font rasterizer, the anti-aliasing, the GPU, the driver, the compositor. Two machines that
report the same WebGL renderer string can still hash differently, because the string and
the pixels are decided by different code. The signature is downstream of everything, which
is exactly why detectors like it and exactly why it is hard to fake by editing properties.
[The renderer string and the pixels it implies are two separate surfaces](renderer-string-vs-render.md),
and a mismatch between them is its own tell.
## The readback is the only thing JavaScript can see
JavaScript never sees the render surface directly; the only bytes a page can obtain are the
ones a readback call hands back. The GPU draws into memory the page has no handle on. The
only way script gets any pixels at all is by calling a readback method -
[`getImageData`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData),
`toDataURL`, `toBlob` on the 2D side,
[`readPixels`](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels)
on the WebGL side - and those methods are
the single point where the rendered pixels cross from the engine into script.
So the signature is not a measurement of your GPU. It is a measurement of whatever those
readback calls return. If the bytes handed back at that boundary are a pure function of a
seed, the signature is a pure function of the seed, and the GPU underneath stops mattering
to the hash entirely.
That is the whole strategy in one sentence: the render can depend on the host all it likes,
because the host contribution is overwritten before any script can observe it.
## What our substitution does at that point
At each readback boundary, the pixels the page receives are replaced with values derived
from the seed and the position of the pixel, roughly `hash(seed, pixel_index)` per byte.
The scene is still drawn, so timing and shape and side effects all behave like a real
render, but the bytes that come back out are seed-determined rather than GPU-determined.
Two consequences follow directly:
- Read the canvas twice in one session and the hash is identical, because the same seed
and the same pixel positions produce the same bytes. A hash that changes between two
reads in one session is the cheapest tampering signal there is, and
[per-call noise is exactly what a consistency probe is built to catch](canvas-fingerprint-noise.md).
- Two different operating systems running the same seed return the same bytes, because
nothing host-specific survives to the readback. That is the property the next section is
about.
Because the substitution happens where the pixels are read rather than where they are
drawn, it covers the indirect readback paths too - drawing the canvas into another canvas
and reading that, capturing it as an image bitmap and reading that - since every one of
them still ends at a readback call, and the readback is what gets replaced.
## Why a byte-identical hash across OSes is the real test
A stealth build that merely perturbs the canvas looks fine on one machine and falls apart
across a fleet, because the perturbation rides on top of a host render that still differs
between Windows and Linux. The honest test is not "did the hash change", it is "do two
different hosts, same seed, produce the same hash to the byte".
Measured on this build, same seed on Windows and on Linux, read in the page the way
BrowserLeaks reads it: the canvas signature is `df2a9319` on both, and the WebGL signature
is `0df1d6f8` on both. Not close, identical.
| Signature | Windows | Linux | Match |
|---|---|---|---|
| Canvas | `df2a9319` | `df2a9319` | byte-identical |
| WebGL | `0df1d6f8` | `0df1d6f8` | byte-identical |
Across a batch of sixteen distinct seeds run
through a full fingerprinting suite, zero of sixteen failed the cross-host check on either
operating system. That is the number that says the host contribution is actually gone
rather than merely reduced, and it is the same guarantee the
[canvas and WebGL cross-platform consistency page](canvas-webgl-cross-platform-consistency.md)
describes from the engine side.
The reason this is worth insisting on: a server render and a laptop render disagreeing is
one of the most common ways an otherwise-good identity gets linked across a fleet. If the
hash is byte-identical by construction, that entire class of leak is closed rather than
papered over.
## The low-entropy render left alone, and why
There is a trap in overwriting every readback unconditionally. Some pages do not draw a
fingerprint scene at all - they draw a tiny reference block, a flat rectangle of one or two
colours, precisely to check whether a browser is tampering with canvas output. A masking
scanner expects that reference to come back byte-exact. If your substitution rewrites it,
you have announced that you rewrite canvas reads, which is worse than any GPU string.
So the substitution has a threshold. A render with more than sixteen distinct colours is a
real fingerprint scene and gets the full overwrite. A render at or below sixteen distinct
colours is treated as a low-entropy reference and is left byte-exact, so its hash stays the
global constant a masking scanner expects to see. The high-entropy scene is spoofed; the
probe render is untouched. A detector looking for tampering on its reference block finds
none, and a detector reading the fingerprint scene gets a clean, seed-stable, host-free
hash.
This is the difference between hiding a signal and blocking it. Blocking canvas entirely,
or scrambling every read, is itself a loud signal - the kind
[a suppressed surface leaves behind](how-to-test-bot-detection.md). Leaving the reference
render exact while making the fingerprint render seed-deterministic is what keeps the
surface quiet.
## Reading the two hashes yourself
You do not need the detector's page to see this. Draw a canvas, read it back the way the
signature is computed, and print the hash. Do it twice in one session to confirm stability,
then relaunch with the same seed to confirm reproducibility.
```python
from invisible_playwright import InvisiblePlaywright
READBACK = """
() => {
const c = document.createElement('canvas');
c.width = 300; c.height = 60;
const ctx = c.getContext('2d');
ctx.textBaseline = 'alphabetic';
ctx.font = '16px sans-serif';
ctx.fillStyle = '#069';
ctx.fillText('signature check', 4, 40);
ctx.strokeStyle = 'rgba(120,0,90,0.7)';
ctx.beginPath(); ctx.arc(240, 30, 20, 0, Math.PI * 2); ctx.stroke();
// the readback: the one point JavaScript sees the render
const bytes = ctx.getImageData(0, 0, c.width, c.height).data;
let h = 0x811c9dc5;
for (let i = 0; i < bytes.length; i++) {
h ^= bytes[i];
h = (h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24))) >>> 0;
}
return h.toString(16).padStart(8, '0');
}
"""
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
first = page.evaluate(READBACK)
second = page.evaluate(READBACK)
print("read 1:", first)
print("read 2:", second)
assert first == second, "canvas hash changed within a session - per-call noise"
```
Run the same script a second time with the same `seed=42` and the printed hash is the same
again. Change the seed and it changes. Run it on a Windows host and on a Linux host with
one fixed seed and the two hosts print the same string. To make the comparison against a
stock browser concrete, run the identical readback under plain Playwright on the same
machine and note that its hash tracks the host GPU instead:
```bash
python read_hash.py # invisible_playwright: seed-stable, host-free
python read_hash_stock.py # stock Playwright: hash follows this machine's GPU
```
The stock browser is the reference. The point is not that the two disagree; it is that the
seeded one gives the same answer on a second machine and the stock one does not.
## Conclusion
The BrowserLeaks canvas and WebGL signatures are hashes of a readback, and the readback is
the only place a page can observe a render at all. That single fact is what makes the
surface tractable: substitute the bytes at the readback boundary with a function of the
seed, and the signature becomes seed-determined instead of GPU-determined, byte-identical
across operating systems, and stable across reads within a session. Leave the low-entropy
reference render exact and a tampering probe finds nothing to flag. The measurable outcome
is a canvas signature of `df2a9319` and a WebGL signature of `0df1d6f8` reproduced to the
byte on two different hosts, with zero cross-host failures across sixteen seeds.
## Short answers to the questions that lead here
**What does the BrowserLeaks canvas signature actually measure?** The hash of the pixels a
readback call returns, not any property of your GPU. It is downstream of the entire render
pipeline, which is why editing a renderer string does not move it.
**Why is my canvas hash different on my server than on my laptop?** Because a plain render
depends on the host GPU, driver and rasterizer, and those differ. When the readback is
replaced with a seed-derived function, the host drops out and the hash is the same on both.
**Should the canvas hash change on every page load?** No. A hash that changes between two
reads in one session is per-call noise, which is itself detectable. It should be stable
within a session and reproducible across sessions for a fixed seed.
**Is blocking canvas a good defence?** No. An empty or scrambled canvas is a loud signal.
The quiet approach returns a plausible, stable hash and leaves a detector's low-entropy
reference render byte-exact.
**Can I get the same signature on two machines on purpose?** Yes, that is the design. Same
seed, same signature, to the byte, on Windows and Linux alike.
**Does this touch the WebGL renderer string too?** That is a separate surface with its own
handling; see the note on [WebGL renderer strings](webgl-renderer-strings.md). The
signature is the pixels, the renderer string is a reported value, and both have to agree.
## Sources
- BrowserLeaks canvas and WebGL pages, read for how the signature is computed: a hash over
the bytes returned by a readback call
([browserleaks.com/canvas](https://browserleaks.com/canvas),
[browserleaks.com/webgl](https://browserleaks.com/webgl)).
- This project's host-independence audit, which maps every path a host-dependent render
value can reach JavaScript and confirms the seeded hashes (`df2a9319`, `0df1d6f8`)
byte-identical on Windows and Linux, zero of sixteen seeds failing the cross-host check.
**See also:** [canvas and WebGL fingerprints identical across OSes](canvas-webgl-cross-platform-consistency.md),
[the cheapest tampering check there is](canvas-fingerprint-noise.md), and
[how to test whether your browser is detected](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The two hashes above are
real measurements, reproduced to the byte on two operating systems from one seed.*
+239
View File
@@ -0,0 +1,239 @@
---
title: "What BrowserLeaks actually tests, surface by surface"
description: "What BrowserLeaks tests, surface by surface: canvas hash, WebGL, WebRTC, fonts, ClientRects. Why a unique panel is not a fail, and the miss it never flags."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 7
---
# What BrowserLeaks actually tests, surface by surface
BrowserLeaks is the tool people reach for when they want to see a number rather than
read a verdict. It prints the raw value of each browser surface - the canvas hash, the
WebGL parameter block, the WebRTC candidate addresses, the installed font list, the
ClientRects geometry - each on its own page, roughly fifteen of them.
That design is its strength and the source of most of the panic it causes. It shows you
everything and scores none of it. So the panel that lights up red and says "unique" is
the one everybody worries about, while the thing that actually gets a session flagged -
two panels that quietly contradict each other - is displayed in plain text and never
called out, because BrowserLeaks does not compare its own pages to one another.
This page is what each surface measures, why "unique" is not the alarm it looks like,
and how to read the tool for the failure it will not point at.
## A raw-value inspector, not a scorer
BrowserLeaks reads each browser surface and prints its raw value; it does not judge whether the values are coherent. It shows the canvas hash, the WebGL block, the font list and how rare each is in its sample, but it never cross-checks one surface against another and never hands you a trust score. That is the distinction that makes it useful, and the one people miss.
[CreepJS asks whether you are lying](creepjs-explained.md): it takes a clean copy of the
built-ins, walks descriptors and prototypes, and cross-checks every surface against
every other one, then hands you a single trust score. BrowserLeaks does none of that. It
reads a value, hashes it if it is a bitmap, tells you how rare that exact value is in its
own visitor sample, and moves on to the next page.
That means two things. First, a "unique" result on any single BrowserLeaks page is a
statement about rarity in their sample, not about whether your browser is coherent. A
perfectly real, perfectly consistent machine can be unique. Second, and this is the part
that matters, BrowserLeaks will show you a Windows font list on one page and a WebGL
renderer that no Windows machine ships on another, side by side, both green, and say
nothing - because it has no page that reads both. The contradiction is on screen. The
tool just is not looking for it.
## The fifteen pages, surface by surface
Each page answers one narrow question. Using them as if they were interchangeable is
most of why people get confused.
- **Canvas.** Draws text and shapes to a `<canvas>`, reads the pixels back, and hashes
them. The hash is a fingerprint of how your specific GPU, driver and font stack
rasterize that exact drawing. It is not a property you can set; it is
[a readback of what the machine actually painted](browserleaks-canvas-webgl-hash.md).
- **WebGL.** Two things on one page: the
[`UNMASKED_VENDOR_WEBGL` / `UNMASKED_RENDERER_WEBGL`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info)
strings, and a long block of numeric limits (max texture size, shader precision
ranges, supported extensions). The strings are the famous part; the numeric block is
the part that has to agree with them, and a disagreement is a contradiction a scoring
detector catches even though BrowserLeaks prints both without comment.
- **WebRTC.** Asks the browser to gather ICE candidates and prints the addresses it
finds. This is where a proxied browser can leak the real local address next to the
proxy exit, or [return nothing at all, which is its own tell](webrtc-leak-proxy.md).
- **Fonts.** Measures the width of a probe string in a long list of font names and
reports which ones are installed. Under a Windows user agent this list must look like
Windows, not [the font set a bare Linux container ships](detect-installed-fonts-javascript.md).
- **ClientRects.** Reads the sub-pixel bounding boxes of positioned elements with
[`getClientRects()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getClientRects).
Like canvas, the exact fractional geometry varies with the
rendering stack, so it is a fingerprint rather than a setting.
There are more pages - TLS, HTTP headers, geolocation, DNS - but these five are the ones
people arrive worried about, and they are all raw-value readouts with no cross-check
between them.
## The panel people fear: "unique" is not "wrong"
The canvas page is the one that sends people to search engines, and usually for the
wrong reason.
It prints "unique" in red, a rarity percentage, and a signature hash, and the instinct
is to make the number stop being unique. That instinct is backwards. A real browser on a
real machine is very often unique on canvas, because the rasterization depends on a
specific GPU and driver combination that few other visitors share. Uniqueness is the
baseline for real hardware, not the anomaly.
The failure modes that actually matter on this panel are the opposite of "unique":
- **A hash that changes on every read.** If you refresh and the canvas signature is
different each time, something is adding per-call noise, and per-call randomness is
itself the tell - a real GPU is deterministic, so
[a hash that will not repeat is the cheapest tampering signal there is](canvas-fingerprint-noise.md).
- **A hash that matches thousands of other visitors exactly.** That is the signature of
a software rasterizer, the same fallback renderer every headless container falls back
to, which is a "this is a datacenter" flag wearing a "not unique" badge.
So the correct thing to want from the canvas panel is not a common value. It is a stable,
plausible, hardware-shaped value that reads identically twice and is not the shared
software-renderer hash. This product derives that value from the seed, so it is unique in
the way real hardware is unique and byte-identical on a re-read, rather than either
randomized per call or collapsed onto the software default.
## The risk it shows but never flags: two panels that disagree
Here is the thing BrowserLeaks displays and will never point at, and it is the thing a
real scoring detector fails you on.
Every surface on the site carries an implicit claim about the same machine. The user
agent says a platform. The WebGL renderer string implies a GPU vendor. The font list
implies an operating system. The canvas and ClientRects hashes imply a specific
rasterization stack. On a real browser these all describe one coherent computer. On a
patched-together disguise they describe two or three different ones, and each individual
page still looks fine on its own.
BrowserLeaks will happily show you:
- A user agent claiming Windows, and a font page missing the fonts every Windows install
ships.
- A WebGL renderer string naming a discrete GPU, and a canvas hash equal to the shared
software-renderer value - the string says NVIDIA while the pixels were drawn by a
software rasterizer.
- A WebRTC page reporting a timezone-consistent exit, and a geolocation page a continent
away.
None of those triggers a warning on BrowserLeaks, because no page reads another page.
CreepJS would collapse your trust score on any one of them. This is exactly the gap the
comparison method in [how to test whether your browser is detected](how-to-test-bot-detection.md)
exists to close: the tool gives you the raw values, and it is on you to check that they
agree, because it will not.
The practical consequence: do not read BrowserLeaks page by page and tick each one green.
Read the values across pages as a set and ask whether one machine could produce all of
them. That is the check the site skips.
## Reading BrowserLeaks with the product, twice and against a stock browser
The way to use BrowserLeaks well is to automate the cross-check it does not do: read the
same surface twice for stability, and read the surfaces together for coherence.
Switching from plain Playwright is a two-line change, and the returned object is a real
Playwright `Browser` with every standard method:
```python
from invisible_playwright import InvisiblePlaywright
# seed fixed, so every surface is reproducible and a failing run can be replayed
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
# 1. Stability: read the canvas signature twice. A real GPU is deterministic,
# so these two hashes must be identical. If they differ, something is
# adding per-call noise, which is a tell in its own right.
page.goto("https://browserleaks.com/canvas")
first = page.locator("#crc").inner_text()
page.reload()
second = page.locator("#crc").inner_text()
assert first == second, "canvas hash changed between reads - per-call noise"
# 2. Coherence: pull the WebGL renderer string and the font list, then check
# they tell the same story about one machine.
page.goto("https://browserleaks.com/webgl")
renderer = page.locator("#webgl-unmasked-renderer").inner_text()
print("WebGL renderer:", renderer)
page.goto("https://browserleaks.com/fonts")
print("fonts detected:", page.locator("#font-count").inner_text())
```
Two rules turn that from a screenshot into a test.
First, assert presence, not absence. A BrowserLeaks page that comes back empty, blocked
or still spinning is a failure, not a clean pass - the WebRTC page returning no candidates
at all reads as clean to a naive check and as suspicious to a real detector.
Second, and this is the one caveat worth being honest about: the raw canvas and WebGL
hashes are stable and reproducible per seed, but they are still *unique*, because real
hardware is unique. If your threat model needs many sessions that are individually
plausible, change the seed per session rather than reusing one - a reproducible
fingerprint is a debugging tool, not a crowd to hide in. Run the same read against a stock
browser on the same machine and diff the two reports field by field; anything that differs
other than the exit address is your candidate, whatever colour the panel is.
## Conclusion
BrowserLeaks is the right tool for reading a specific surface and the wrong tool for
deciding whether you are safe. It prints raw values page by page and scores none of them,
so the "unique" canvas panel that scares people is usually just real hardware behaving
normally, while the failure that actually matters - two panels describing two different
machines - is on screen in plain text with no warning attached.
Read it as a set, not a stack of independent verdicts. Check that each value is stable on
a re-read, check that the values across pages could all come from one computer, and diff
the whole thing against a stock browser. Do that and BrowserLeaks becomes a precise
instrument. Read it panel by panel and it will scare you about the wrong number and stay
silent about the right one.
## Short answers to the questions that lead here
**BrowserLeaks says my canvas is unique - am I detected?** Almost certainly not.
Uniqueness is the baseline for real hardware, which rasterizes in a way few other
visitors share. The tell is the opposite: a hash that changes every read, or one that
matches thousands of others exactly.
**Does BrowserLeaks give a bot score?** No. It is a raw-value inspector. It prints each
surface and how rare it is, but it never scores cross-surface consistency the way CreepJS
does, so it cannot tell you whether your surfaces agree with each other.
**Why does BrowserLeaks look clean but I still get blocked?** Because it showed you values
that individually look fine and never checked that they describe one machine. A Windows
user agent with a Linux font list passes every BrowserLeaks page and fails a real
detector.
**Which BrowserLeaks page matters most?** None alone. The value is reading them together:
the canvas, WebGL, font and WebRTC pages have to tell the same story about one computer.
**How do I know if my canvas hash is randomized?** Load the canvas page twice. A real GPU
gives the identical hash both times. If it differs, something is injecting per-call noise,
which is itself a signal.
**Should I try to make my canvas hash common?** No. Common usually means the shared
software-renderer value that every headless container falls back to, which reads as a
datacenter. You want a stable, hardware-shaped, unique value, not a popular one.
## Sources
- The BrowserLeaks surfaces named above, each read from its own page rather than from a
summary score.
- This project's release gates, including the WebRTC gate whose absence-only assertions
passed a feature that returned nothing, and the seed-derived canvas readback checked for
stability across reads.
- The companion detector pages in this set, read from each tool's own behaviour.
**See also:** [how CreepJS scores the cross-surface consistency BrowserLeaks skips](creepjs-explained.md),
[what the canvas and WebGL hash actually measures](browserleaks-canvas-webgl-hash.md), and
[the comparison method that catches contradictions no single panel flags](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The seed makes every surface
reproducible, so the two-read stability check above is a test rather than a guess.*
+244
View File
@@ -0,0 +1,244 @@
---
title: "How to make Linux and macOS report real Windows fonts"
description: "To make Linux and macOS report real Windows fonts, bundle the real font files and read only from them. Filtering a list leaves the host's rendering underneath."
parent: "Canvas, WebGL, Fonts and Audio"
grand_parent: "Guides"
nav_order: 6
---
# How to make Linux and macOS report real Windows fonts
To make Linux and macOS report real Windows fonts, ship the real Windows font files
inside the browser and read only from that bundle on every platform. Filtering a host's
font list is not enough: it changes what gets reported, not what gets rendered - the
list says Windows, the pixels say something else. This page is what it took to make that
bundle hold on three unrelated font backends, and where it still leaks.
[Why headless browsers render different fonts](headless-fonts-differ.md) covers the
detection side of the same problem, if you want that first.
## Why filtering the host was never going to be enough
The first instinct is to filter: hide the host's real fonts, report a Windows-shaped
list instead. We tried a version of this and reverted it, because filtering only
changes what gets reported, not what gets rendered. The host still draws the glyphs,
still measures the widths, still rounds however its rasteriser rounds. A filtered font
*name* sitting on top of Linux font *rendering* is a different, subtler version of the
same contradiction: the list says Windows, the pixels say something else.
The fix that actually holds is upstream of the whole problem: ship the real font
files inside the browser, and read only from that bundle, on every platform. This is
the same direction Camoufox took first, and for the same reason - a real file produces
real glyphs, real metrics, and a real hash, because nothing about it is simulated.
## One manifest, so three backends can't disagree with each other
Firefox already has a mechanism for carrying fonts inside the binary,
`MOZ_BUNDLED_FONTS`, on by default on Windows and Linux and available on macOS with a
build flag. The harder problem isn't shipping the files, it's making Windows'
DirectWrite, Linux's fontconfig and macOS's CoreText - three font backends that know
nothing about each other and enumerate host fonts in three different ways - report the
*same* family list from the *same* files.
The fix is a single manifest, generated offline from the font files themselves and
checked in as data, listing every family and which file and face index backs it. All
three backends read the same manifest instead of asking their platform's normal font
enumeration, so instead of three per-OS filters that can quietly drift apart, there is
one source of truth for what a family is called and where its data lives.
Two details in that manifest turned out to matter more than the format itself:
**Naming has to follow the same precedence a real OS uses**, or the family names
themselves become the tell. Font files carry more than one candidate name - a
typographic name, a GDI-compatible name, sometimes a WWS name - and which one Windows
actually shows depends on a precedence order. Getting that order wrong produces a
family list that is real but *shaped* wrong: a font's marketing name where a real
Windows machine would show its GDI name, which is exactly the kind of small
inconsistency [consistency-based detection](playwright-detected-as-bot.md) is built to
catch.
**Multi-face font files can't be indexed positionally across platforms.** A single
`.ttc` file can carry several unrelated faces - regional CJK variants, for instance -
and the safe way to pick the right one turned out to differ by backend: an index that
is reliable on one platform is not guaranteed to point at the same face on another,
because not every platform documents face order as stable. Matching by the face's own
embedded name instead of its position avoids picking the wrong face silently.
## Making three backends refuse to fall back to the host
A manifest is only half the fix. Each backend still has its own default behaviour when
something isn't in its bundle-only list, and each of those defaults quietly reaches for
the host if you don't close it explicitly:
- One backend's safety fallback, when the bundle is unreadable, is to fail toward an
empty list rather than the host - which breaks rendering visibly instead of leaking
silently, the correct failure direction for a fingerprinting surface.
- Another's default path, taken naively, falls straight through to a live host
enumeration call the moment the bundle-only condition isn't satisfied.
- The third had no bundle-only mode at all going in; it enumerates host and bundled
fonts through the same single API call, so keeping the host out requires filtering
every result rather than skipping a call.
Closing all three took a different patch per backend, because "don't enumerate the
host" means something different to DirectWrite, to fontconfig, and to CoreText. There
is no single flag that does this once for all platforms.
## The macOS gap: two layers, and only one was visible without a Mac
CoreText's version of this fix shipped later than Windows' and Linux's, and not
because it was harder to write. It was harder to *know was wrong*, because nobody
doing the work had a Mac to run it on.
**Layer one, found by reading the code rather than running it:** the block-at-birth
hook that stops each backend from falling back to a live host enumeration had been
wired into the Windows and Linux font backends, and simply never ported to CoreText.
Reading the three backends side by side made that omission visible without running
anything - a Mac host would enumerate its own system fonts right alongside the bundle,
leaking the host OS on the one platform where nobody could see it happen locally.
**Layer two surfaced only when the first fix actually ran in CI.** Porting the hook
and shipping it should have closed the gap. It didn't: the very next automated
macOS run still showed most of the bundle missing and several real host fonts
leaking through, on a build that had compiled cleanly and looked, from the source,
like a complete fix. The actual cause was one level down - the build configuration
that turns bundled fonts on at all was set to enable itself only on two of the three
target platforms. The third silently defaulted off, which also compiled out the very
hook layer one had just added, since that code only exists when bundled fonts are
built in. A hook that is correct and a build that never includes it produce the same
observed nothing.
Both layers are closed now, and CoreText enumerates the identical family set the
other two backends do. The reason this is worth telling as one story rather than two
separate fixes: the first fix looked complete by every check available without a
real Mac, and was not. The only thing that caught the second layer was an automated
run on the actual operating system, checking the actual output, after the fix that
was supposed to be the whole answer. A gate that runs somewhere other than the real
target platform is checking a different, easier question.
## What this validates, and what it costs
Validated cross-platform: Windows and Linux expose the identical family set from the
bundle, zero host fonts leaking through on either,
[generic CSS families](https://www.w3.org/TR/css-fonts-4/) (serif, sans,
monospace, and the per-script CJK generics) resolving to the same bundled fonts rather
than collapsing to whatever the host happens to have. The same check on macOS runs in
CI rather than locally, for the ordinary reason that not every setup has a Mac to test
on, and it has passed there too.
The cost is real and worth naming rather than glossing over. The binary is
meaningfully larger, because it now carries real font files rather than relying on
whatever the OS already had installed. And a fixed bundle also fixes the family list
in time: unlike a live host, the browser cannot pick up a font a real Windows Update
might add later. Both are the price of an answer that has no per-platform seams to find.
## Where it still leaks, named rather than hidden
Consistent with treating a suppressed signal as a fail rather than a pass, the honest
gaps in this approach, found and not yet closed:
- One backend's [CSS `local()`](https://www.w3.org/TR/css-fonts-4/) font lookup path
isn't wired to the bundle-only mode at all, so a page asking for a font by exact name
through that specific CSS feature fails to resolve where a real installation would have. A resolved lookup versus a
failed one is itself a detail a determined check could compare.
- One backend's fallback for a character outside the bundle's family set reaches
straight for the real host catalogue rather than staying inside the bundle, so an
uncommon glyph can momentarily surface real host font data.
- One backend's `system-ui` generic keeps a narrow live query against the host font
service as an extra fallback candidate, a single generic family that didn't get
folded into the same guard as the rest.
- One platform's font-substitution mechanism reads a live OS-level alias table
regardless of bundle-only mode, so the set of names that resolve through it still
varies by the specific machine's own configuration.
None of these are enumeration leaks in the sense the validation above checks for -
that check passed, repeatedly, on real measurement. They are narrower seams: specific
code paths that keep a live dependency on the host font service instead of routing
through the bundle like everything else. Each is a known, open item rather than
something papered over, because a gap you haven't found yet is worse than one you have.
## A closed example of the same class: enumeration passing while rendering was wrong
Before the manifest fixed multi-face naming across platforms, a narrower version of the
same problem shipped and was found and closed on Linux specifically. It is worth
walking through because it is the clearest illustration of why enumeration alone is
never enough of a check.
A `.ttc` file is a collection: several complete faces sharing one set of font tables,
addressed through a `TTCHeader` that starts with the four-byte marker `ttcf` instead of
the single-face `sfnt` header an ordinary font file has. Several bundled CJK families -
regional Chinese, Japanese and a couple of serif/math variants - ship as `.ttc`
collections for exactly that reason: related faces, one file.
The font-table code on Linux never checked for that marker. It read every font file as
if it only had one face, at a fixed offset from the start of the file. For an ordinary
font that offset is correct. For a `.ttc` collection it lands wherever the first face's
data happens to be, regardless of which face was actually requested by name.
The result was a font that enumerated correctly - the family name resolved, the browser
reported it was using the right font - while the glyphs actually rendered came from
whichever face happened to sit at that fixed offset. Measured directly: metrics for
several of these families were wrong on Linux and correct on Windows, same seed, same
manifest, same claimed font name. Enumeration was clean. Rendering was not. That gap is
exactly what a check that stops at "is the font in the list" cannot see.
The fix adds a lookup that reads the `TTCHeader` when the `ttcf` marker is present,
finds the requested face's own offset from the collection's face-directory table, and
reads from there instead of assuming offset zero. After the fix, the same measurement
that had shown a mismatch showed matching metrics on both platforms, for every affected
family.
The general lesson is the same one the four seams above are named for: a signal that
looks closed because the obvious check passed is not the same as a signal that is
closed. This one needed a metrics comparison, not a font list, to be caught at all -
and it was a real, shipped gap for a period, not a hypothetical one.
## Conclusion
Filtering a host's fonts leaves the host's rendering underneath, which is a
contradiction with extra steps. Shipping the real files and reading only from them
removes the contradiction at the source, at the cost of a larger binary, a fixed
family list, and three separate backends that each needed convincing not to reach for
the host on their own. What's left is a short, named list of narrower seams, not a
general claim that the surface is closed.
## Short answers to the questions that lead here
**Can I make a Linux machine report Windows fonts?** Reporting the name is not the
hard part; matching the rendering is. Bundling the actual font files and reading only
from them is what makes the two agree.
**Does installing Windows fonts on Linux fix fingerprinting?** It gets you the right
names. It does not by itself stop the browser's normal font backend from also seeing
whatever else is on the host, and licensing is a separate problem again.
**Why not just spoof the font list in JavaScript?** There's no enumeration API to
intercept; [detection works by measuring rendered text](detect-installed-fonts-javascript.md),
and a script cannot change what the OS actually draws.
**Does this fix cost anything?** A larger binary, and a font list that's frozen at
build time rather than tracking whatever the real OS might add later.
**Is this the same thing Camoufox does?** The same direction - real files, not a
filter - checked independently rather than assumed to work the same way underneath.
**See also:** [why headless browsers render different fonts](headless-fonts-differ.md),
for the detection side this architecture answers; [invisible_playwright vs Camoufox](vs-camoufox.md),
for where this approach sits relative to theirs; and
[WebGL renderer strings](webgl-renderer-strings.md), for the same shape of problem on
different hardware.
## Sources
- This project's own font-bundle architecture and its per-platform integration work,
including the validated cross-platform measurement (Windows/Linux locally,
macOS in CI) and the four open gaps listed above.
- Firefox's own bundled-fonts build mechanism, which this architecture builds on
rather than replaces.
- [CSS Fonts Module Level 4](https://www.w3.org/TR/css-fonts-4/) (W3C), for the generic
font family keywords and the `local()` src descriptor referenced above.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level, including three separate font backends convinced not
to ask their host anything.*
@@ -0,0 +1,224 @@
---
title: "Can a website detect a virtual machine?"
description: "How a website infers a VM: software GPU renderers, odd core and memory counts, missing audio, generic metrics - what a browser fingerprint can and cannot hide."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 15
---
# Can a website detect a virtual machine?
Short version: a website cannot see your hypervisor directly, but it can read a
handful of browser-visible values that a virtual machine or a cloud instance tends to
get wrong, and it can add them up into a VM-likelihood score. So the honest answer is
"partly". It can guess from what the browser reports, and it usually cannot prove
anything from inside the page. What it can prove lives outside the browser: the exit
IP and the network handshake.
This page is what a detector actually looks at, why a default VM answers those
questions in a way that stands out, how a real-hardware persona changes the answers,
and the parts that a browser fingerprint does not and cannot touch.
## What a detector can see, and what it cannot
A page runs JavaScript. JavaScript can read the values the browser chooses to expose,
and nothing below that line. It cannot read the CPUID leaf that says "hypervisor
present", it cannot query the BIOS vendor string, it cannot see the virtual disk
controller. Those are the classic VM tells, and they belong to native malware analysis,
not to a web page.
What a page can do is infer. Every value below is individually plausible and, taken
together, describes a machine. A physical desktop and a headless cloud instance answer
these questions differently, and a detector that has scored a few million real browsers
knows what the physical desktop looks like.
- The GPU vendor and renderer string.
- The number of logical CPU cores.
- The reported device memory.
- Whether an audio output device exists, and what it sounds like.
- The screen geometry and pixel ratio.
None of these is an automation flag. They are all "this is probably not someone's
desktop" flags, which is a different and often more damaging thing.
## The signals that feed a VM score
Here is what each one looks like when it comes from a virtualized or headless
environment, and why it stands out.
**A software or generic GPU renderer.** A machine with no graphics hardware falls back
to a software rasterizer, and the [WebGL renderer
string](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info)
says so in plain text: a basic or generic renderer name, or the well-known software
rasterizer strings. A real desktop reports a specific GPU model from a specific vendor.
This is the single loudest VM tell
in the browser, because it is a string you can read directly rather than a statistic
you have to accumulate. Worse, the string and the pixels can disagree: a renderer that
names real hardware while a software path actually draws the frame is
[a mismatch you cannot paper over with a property override](renderer-string-vs-render.md).
The full surface is in [WebGL renderer strings](webgl-renderer-strings.md).
**Odd core and memory counts.**
[`navigator.hardwareConcurrency`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/hardwareConcurrency)
and
[`navigator.deviceMemory`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/deviceMemory)
are coarse, but their distribution across real browsers is not uniform. A tiny core
count paired with a claim of a modern desktop, or a memory
value that never appears on consumer hardware, moves the score. These two also have to
agree with each other and with the rest of the persona, which is
[why pinning one without its neighbours backfires](hardware-concurrency-device-memory.md).
**Missing or default audio.** An
[`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API)
exposes a sample rate, an output latency and a channel count that come from a real
audio device. A container with no sound hardware answers with defaults that say
exactly that, and the rendered audio
fingerprint carries the same information. See
[AudioContext fingerprinting](audiocontext-fingerprinting.md) for what is actually
being measured.
**Generic display metrics.** A resolution nobody ships, a device pixel ratio no real
panel has, an available screen height equal to the full height (meaning no taskbar and
no window chrome). Each of these is a small nudge; together they describe a virtual
framebuffer rather than a monitor.
A detector does not need any single one of these to be damning. It needs several of
them to point the same way at once, which is exactly what an unconfigured VM delivers.
## What invisible_playwright does about the browser-visible layer
invisible_playwright is a Firefox patched at the C++ level and driven by stock
Playwright. Its whole design is to look like a real browser run by a real person, and
that is why it passes most fingerprint, TLS and driver-layer checks: those layers read
as a genuine Firefox because the browser genuinely is one, not a JavaScript costume
over a headless engine.
For the VM signals specifically, the build derives one coherent real-hardware persona
from a seed and overrides the browser-visible values to match it: the WebGL vendor and
renderer name a real GPU (and the pixels are drawn to agree with the string, not just
the string), `hardwareConcurrency` and device memory take values a real desktop
reports, the `AudioContext` presents a real device's output characteristics, and the
screen metrics describe a physical display. Every field is drawn from the same seed, so
they agree with one another rather than being individually plausible and jointly
contradictory, which is the failure mode a VM score is built to catch.
Switching from plain Playwright is two lines, and the operation this page is about -
loading a page that scores your environment - is ordinary Playwright after that:
```python
from invisible_playwright import InvisiblePlaywright
# same seed -> same GPU, cores, memory, audio and screen every run
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# read the values a VM detector would read
report = page.evaluate("""() => {
const gl = document.createElement('canvas').getContext('webgl');
const dbg = gl && gl.getExtension('WEBGL_debug_renderer_info');
return {
renderer: dbg ? gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL) : null,
cores: navigator.hardwareConcurrency,
memory: navigator.deviceMemory,
sampleRate: new (window.AudioContext || window.webkitAudioContext)().sampleRate,
screen: [screen.width, screen.height, window.devicePixelRatio],
};
}""")
print(report)
```
Run that inside the build and the renderer names a real GPU, the core and memory
counts sit in the range real desktops report, the sample rate is a real device's, and
the screen looks like a monitor. Run it in a stock headless browser on the same cloud
instance and you will typically see a software renderer, a low core count and screen
metrics that describe a framebuffer. That difference is the VM score, and it is the
part a browser can control.
Because the persona is seed-derived, `seed=42` gives the same machine on every run,
which is what makes a suspicious result reproducible instead of a one-off you cannot
chase.
## The parts a browser fingerprint cannot fix
This is the honest caveat, and skipping it is how people get surprised.
Matching the browser-visible layer to a real desktop covers the browser-visible layer.
It does nothing about:
- **The exit IP.** A datacenter address is a datacenter address, and a large share of
VM detection in practice is just the IP's reputation and ASN. A perfect persona on a
known cloud range still reads as a cloud instance. You supply the exit; the build
only sets the browser to match it. See
[why a container gets caught on the network and machine layers](playwright-docker-detection.md).
- **Hypervisor timing side-channels.** Some detectors time operations whose cost
differs under virtualization. That is a property of the CPU you are actually running
on, not of any value the browser reports, and no fingerprint override changes it.
- **Behaviour, rate and quota.** Human pacing, per-account limits and request velocity
are yours to supply. A consistent browser hammering one endpoint from one address
creates the exact signal it was trying to avoid.
So invisible_playwright helps with the browser-visible half of VM detection and does
not, on its own, fix the IP, the timing floor or your behaviour. It is designed to be
paired with a clean residential exit and human pacing, not to replace them. There is no
setting that makes a browser undetectable, and any tool that claims one is selling the
claim rather than the result.
## Conclusion
Can a website detect a virtual machine? It can make a strong guess from the browser
side - a software GPU renderer, odd core and memory counts, missing audio, generic
display metrics - and it can prove very little from inside the page while proving quite
a lot from your IP and handshake. invisible_playwright addresses the guessable,
browser-visible half by presenting one coherent real-hardware persona instead of the
default VM answers, and it is honest about the half it does not touch. Match the
browser to a real desktop, put it behind a clean exit, pace it like a person, and the
VM score stops being the thing that gives you away. Get any one of those three wrong and
the other two will not save you.
## Short answers to the questions that lead here
**Can JavaScript detect that I am in a VM?** Not directly. It cannot read CPUID, BIOS
strings or the hypervisor. It infers from browser-visible values like the GPU renderer,
core count, audio device and screen, and scores how VM-like they look together.
**What is the biggest browser-side VM tell?** A software or generic WebGL renderer
string. It is a value you can read in plain text rather than a statistic you have to
accumulate, so it stands out immediately.
**Does invisible_playwright hide that I am on a cloud server?** It fixes the
browser-visible signals - GPU, cores, memory, audio, screen - to one coherent real
desktop persona. It does not change your IP, which is often the actual reason a cloud
session gets flagged.
**Can a website detect a VM through timing?** Some detectors time operations that cost
more under virtualization. That is a property of the CPU you run on, not a browser
value, so no fingerprint override affects it.
**Will a real-hardware persona alone get me through?** No. Pair it with a clean
residential exit and human pacing. The persona covers the machine the browser reports,
not the address it connects from or how fast you click.
**Is there a setting that makes the browser undetectable?** No, and be wary of anything
that says otherwise. This lowers the browser-visible VM score to a real desktop's; the
IP, timing floor and behaviour are still yours to get right.
## Sources
- The public fingerprint suites this project tests against, read for which environment
values they collect and how they weight them - GPU renderer, hardwareConcurrency,
deviceMemory, AudioContext output and screen metrics.
- This project's release gates, which compare each of those fields against a stock
Firefox on the same machine rather than reading a verdict.
**See also:** [WebGL renderer strings](webgl-renderer-strings.md) and
[hardwareConcurrency and deviceMemory](hardware-concurrency-device-memory.md) for two
of the signals above, and [how to test whether your browser is detected](how-to-test-bot-detection.md)
for the compare-against-stock method that catches a VM tell a verdict hides.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. It presents one coherent
real-hardware persona to the browser-visible layer; the IP, the timing floor and the
pacing are still yours to supply.*
@@ -0,0 +1,221 @@
---
title: "Can a website detect Clipboard API access?"
description: "A page can see navigator.clipboard and query clipboard-read permission state, but the async Clipboard API is a gesture gate, not a value fingerprint you leak."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 21
---
# Can a website detect Clipboard API access?
Short version: a page can see that `navigator.clipboard` exists and it can ask the
Permissions API what state `clipboard-read` is in, so yes, it can observe your
relationship with the clipboard. What it mostly cannot do is turn that into a stable
fingerprint of your machine. The Clipboard API is interesting to a detector for a
different reason than canvas or WebGL are: it is not a value you leak, it is a gate that
only opens for a real user gesture, and its permission state has to agree with a second
API that reports the same thing.
This page is what the async Clipboard API actually exposes, why it behaves as a gate
rather than a fingerprint, the cross-check a detector runs against it, how to drive it
with a real trusted click, and the honest limit of what a patched browser does here.
## What the async Clipboard API actually exposes
The modern surface is the [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API)'s
`navigator.clipboard`, with two methods that matter for detection:
`writeText()` and `readText()` (plus their richer `write()`/`read()` cousins). Both return
promises, and both are guarded before they ever touch the system clipboard.
A page can read three things without any special access:
- **Whether `navigator.clipboard` is present at all.** A secure context (HTTPS) in a
modern browser has it; its absence under a modern user agent is itself a mismatch.
- **The permission state for `clipboard-read`**, by asking the
[Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API)'s
`navigator.permissions.query({name: 'clipboard-read'})`. That returns `granted`,
`denied` or `prompt` without prompting anyone.
- **What happens when it calls a method.** A rejected promise, and the shape of the
rejection, tells the page which guard tripped.
None of those three is a serial number. They describe policy, not hardware, and that is
the whole point of this surface.
## Why clipboard is a gate, not a value fingerprint
Canvas gives back a hash. WebGL gives back a renderer string. The clipboard gives back
almost nothing that varies from one honest machine to the next, because access is gated
on two conditions the specification requires:
1. **A user gesture.** `readText()` and `writeText()` are only allowed while the document
has [transient activation](https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/User_activation),
meaning a real interaction (a click, a key press) happened
recently. Call either one from a script with no gesture behind it and the promise
rejects.
2. **A permission.** Reading additionally requires the `clipboard-read` permission;
writing is allowed under a gesture in most configurations but can also be governed by
`clipboard-write`.
For an automation setup this is exactly the kind of check that separates a real browser
from a spoofed one, and it separates them on *behaviour*, not on a leaked value. A script
that dispatches its own synthetic `click` event to satisfy the gesture requirement fails,
because a page-built event carries `isTrusted=false` and does not count as activation.
This is the same boolean that decides
[whether an automated click reads as real input](playwright-clicks-istrusted.md): the
clipboard gate sits directly on top of it.
So the detector question is not "what is your clipboard value". It is "does the clipboard
open for you the way it opens for a person", and the answer depends on whether your
clicks are trusted.
## The cross-check: permission state must agree with the Permissions API
The sharper check does not call the clipboard at all. It reads two answers to the same
question and looks at whether they line up.
`navigator.clipboard` being present implies a certain permission model. The Permissions
API is then asked directly: `query({name: 'clipboard-read'})`. On a coherent, real
browser those two facts describe one consistent policy. On an over-patched setup, where
someone bolted on `navigator.clipboard` or forced a permission state from JavaScript
without moving the other half, the two disagree, and the disagreement is the tell.
It is the same shape as
[the notifications permission mismatch](permissions-api-consistency.md), where
`Notification.permission` and `navigator.permissions.query({name: 'notifications'})` are
expected to give one coherent answer and a headless browser gives two. Clipboard adds a
third instance of the pattern, alongside
[the notification-state cross-check detectors already run](notification-permission-detection.md).
Nobody has to recognise automation directly; they just ask the same thing twice through
different code and compare.
A patched-at-the-engine build does well here for an unglamorous reason: it is a real
Firefox. The permission plumbing is the browser's own, so the Permissions API answer and
the clipboard's actual behaviour come from one source and cannot contradict each other the
way a page-level shim does. There is nothing to keep in sync because nothing was bolted
on.
## Reading the clipboard with invisible_playwright
Because Playwright's clicks go through the native input path, they arrive as trusted
gestures, so the clipboard gate opens exactly as it would for a hand on the mouse. The
launch is the usual two lines, and after that everything is stock Playwright:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# A page button whose handler calls navigator.clipboard.writeText(...).
# The Playwright click is a trusted gesture, so the write is permitted.
page.click("#copy-button")
# Inspect the surface the way a detector would: presence plus the
# permission state that has to agree with it.
report = page.evaluate("""async () => {
const present = 'clipboard' in navigator;
let readState = 'unavailable';
try {
const s = await navigator.permissions.query({ name: 'clipboard-read' });
readState = s.state; // 'granted' | 'denied' | 'prompt'
} catch (e) {
readState = 'query-failed';
}
return { present, readState };
}""")
print(report) # e.g. {'present': True, 'readState': 'prompt'}
```
The values you get back are the ones a genuine Firefox returns: `navigator.clipboard`
present in the secure context, and a `clipboard-read` state that matches the browser's
real policy rather than a hand-forced constant. If you need to grant clipboard permissions
explicitly for a `readText()` flow, use Playwright's own
`context.grant_permissions([...])` on the browser context, exactly as you would with
upstream Playwright; there is no separate API to learn here.
The measurable point is the one from the section above: the presence flag and the
permission state agree, and a click-gated `writeText()` succeeds because the gesture was
trusted. That agreement is what the cross-check is looking for, and it is a property of
being a real browser rather than of any value we inject.
## What this does not fix
Passing the clipboard cross-check is a fingerprint-and-driver-layer win, and it is worth
being blunt about where that win stops.
- **IP reputation.** The clipboard gate has nothing to do with your exit address. A
coherent clipboard on a datacenter IP is still on a datacenter IP. Supply a clean exit;
see [Configuration](configuration.md) for the proxy setup.
- **Per-account quotas and rate limits.** Looking like a real browser does not raise a
limit that is counted per account or per address. Those are policy on the other side,
not a browser property.
- **Behaviour and timing.** The gate cares that a gesture is trusted, not that your pacing
is human. A trusted click fired in a machine-perfect rhythm is still a rhythm a watcher
can measure.
- **Clipboard prompts by design.** Some `readText()` flows are meant to prompt a human.
Automating your way around a deliberate consent step is a different problem from looking
real, and this page is only about the second.
invisible_playwright is built to look like a real browser driven by a real person, which
is why the fingerprint, the TLS handshake and the driver layer read as a genuine Firefox
and why checks like this one pass. It does not launder a bad IP or manufacture pacing.
Those you supply: a clean proxy and human-shaped behaviour.
## Conclusion
A website can absolutely detect that you are touching the Clipboard API, and it can read
your `clipboard-read` permission state without prompting. But the async Clipboard API is a
gate, not a value fingerprint: access opens only for a real trusted gesture, and the
permission it reports has to agree with the Permissions API's answer for the same thing.
A patched-at-the-engine Firefox driven by stock Playwright clears both because the gesture
is genuinely trusted and the permission plumbing is the browser's own. That handles the
browser side. The exit and the pacing are still yours to get right.
## Short answers to the questions that lead here
**Can a website tell if I read the clipboard?** It can see that `navigator.clipboard`
exists and query the `clipboard-read` permission state. A silently rejected read also
tells it which guard tripped. It cannot turn any of that into a stable machine
fingerprint.
**Is the Clipboard API a fingerprinting surface?** Barely, in the value sense. It is a
permission-and-gesture gate, so its interest to a detector is consistency and access
behaviour, not a hash that varies between machines.
**Why does `readText()` reject in my automation?** Most often because there was no trusted
user gesture, or the `clipboard-read` permission was not granted. A script-dispatched
click does not count as a gesture.
**Do Playwright clicks satisfy the gesture requirement?** Yes. They go through the native
input path and arrive as trusted events, so the clipboard gate opens as it would for a
real user.
**What is the clipboard cross-check?** A detector compares `navigator.clipboard` presence
against the Permissions API state for `clipboard-read`. On a real browser they describe
one policy; a page-level shim that forces one without the other makes them disagree.
**Does a coherent clipboard mean I will not get blocked?** No. It is one browser-side
signal. IP reputation, per-account quotas and behaviour are separate and are yours to
handle.
## Sources
- The WHATWG and W3C definitions of the async Clipboard API and the Permissions API,
including the user-activation and `clipboard-read`/`clipboard-write` requirements, read
from the specifications rather than from a blog summary.
- This project's own permission and gesture gates, which check that a click-gated
operation succeeds under a trusted event and that the permission state a page can query
agrees with the browser's real policy.
**See also:** [the trusted-click boolean the clipboard gate sits on](playwright-clicks-istrusted.md),
[the permission answers that must agree](permissions-api-consistency.md), and
[the notification cross-check detectors already run](notification-permission-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The clipboard opens for it
because the gesture is genuinely trusted, not because a value was faked.*
@@ -0,0 +1,205 @@
---
title: "Can a website tell you are running on a server?"
description: "Websites spot a datacenter or headless host via software WebGL, missing audio, headless metrics, datacenter ASN - and what a real fingerprint can fix and cannot."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 25
---
# Can a website tell you are running on a server?
Often, yes. Not because the code is automated, but because the host is a server:
no GPU, no sound card, no monitor, and an address that belongs to a datacenter. A
browser running there answers a handful of ordinary questions in a way that only a
server answers them, and a detector does not need anything clever to notice.
The honest split is worth stating up front. Most of these tells are JavaScript-visible
properties of the machine, and a browser that presents a real desktop persona answers
them the way a desktop does, whether the host underneath is a laptop, a Linux VM or a
Docker container. One of them is not a browser property at all: the exit IP is read at
the network layer, before any script runs, and no browser can disguise it. That one is
yours to solve with a clean proxy.
## What a server actually leaks
The failures that get a headless-host session blocked are almost never automation
flags like [`navigator.webdriver`](navigator-webdriver-explained.md). Those are solved
by every serious tool on day one. The ones that survive are hardware questions the
machine cannot answer honestly:
- **The GPU**, read through the [`WEBGL_debug_renderer_info`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info)
extension, which on a server is drawn by software.
- **The audio device**, read through [`AudioContext`](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext), which on a server does not exist.
- **The screen**, whose resolution, available height and device pixel ratio describe
a display that no real desktop has.
- **The exit address**, whose ASN says datacenter.
None of these are in JavaScript's gift to change from a page-level script, which is
why a stealth plugin bolted onto a stock headless browser does not touch them. They
are decided by the box the browser runs on. The rest of this page walks the first three
(which a real-browser build answers on the browser side) and then the fourth (which it
cannot).
## The software renderer tell
Ask a browser on a normal desktop what draws its graphics and it names a real GPU
vendor and model. Ask a browser on a server and, if it renders WebGL at all, it names
a software rasterizer: strings like `llvmpipe` or `SwiftShader`, or a generic "software"
renderer. That string is a plain statement that there is no graphics hardware present,
and a detector reads it as exactly that.
There is a subtler version of the same tell, and it is the one that catches half-fixes:
the renderer string can be edited to say a real GPU while the pixels are still drawn by
software. A page that draws a scene and reads back the result gets output that does not
match the name, which is [a mismatch you cannot patch from a string override](renderer-string-vs-render.md).
The name and the pixels have to agree.
invisible_playwright presents a real GPU persona, and the readback matches it, because
the presented persona is what actually answers both the string query and the render.
The [WebGL renderer strings page](webgl-renderer-strings.md) covers what a consistent
vendor/renderer pair looks like and why the two halves have to line up.
## The missing audio device and the headless screen
Sound is the same story as graphics. An AudioContext reports a sample rate, an output
latency and a channel count, and on a real machine those come from a real sound card.
A container has none, so it answers with the defaults that a headless host produces,
and the defaults are a signature. An empty or default audio profile under a desktop user
agent is a server saying it is a desktop. The mechanism is in
[AudioContext fingerprinting](audiocontext-fingerprinting.md).
The screen is the third. Headless hosts report resolutions nobody runs, a device pixel
ratio no physical display has, and an available height equal to the full height, which
means there is no taskbar because there is no desktop. Each value on its own is weak;
together they describe a monitor that does not exist. The full set of these is in
[screen size and other headless tells](screen-size-headless-tells.md).
A real-browser build answers all three as a Windows desktop would: a real GPU persona,
a real AudioContext output, and Windows screen metrics with a plausible available height
and device pixel ratio. Those answers are the same whether the host is your laptop or a
Linux container, because they are presented by the browser rather than read from the box.
## What invisible_playwright presents instead
The launch is two lines, and the browser you get back is a real Playwright `Browser`,
so every method is the one you already know. Here is the launch plus reading back the
three signals this page is about:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
report = page.evaluate("""() => {
const gl = document.createElement('canvas').getContext('webgl');
const dbg = gl.getExtension('WEBGL_debug_renderer_info');
const ac = new (window.AudioContext || window.webkitAudioContext)();
return {
renderer: gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL),
vendor: gl.getParameter(dbg.UNMASKED_VENDOR_WEBGL),
sampleRate: ac.sampleRate,
screen: [screen.width, screen.height, screen.availHeight],
dpr: window.devicePixelRatio,
platform: navigator.platform,
};
}""")
print(report)
```
Run that on a Linux server or inside a container and the renderer names a real GPU, the
vendor matches it, the AudioContext reports a desktop sample rate, the screen metrics
describe a Windows display with a taskbar, and `navigator.platform` reads `Win32`. The
same `seed=42` produces the same persona every run, so a value you saw once is a value
you can reproduce and diff, rather than a fresh random draw each launch.
Because the browser is a genuinely patched Firefox driven by stock Playwright, the layers
underneath the JavaScript match too: the TLS handshake and the driver surface read as a
real Firefox rather than as an automated one. That consistency is the reason it passes
most detection checks, and the way to confirm it is by comparison against a stock browser
on the same machine rather than by trusting a single verdict.
## The boundary: the datacenter IP is still visible
Here is the caveat, stated plainly because a page that only lists what it fixes is not
honest. Everything above happens inside the browser, at the JavaScript layer. The exit
IP does not. The server reads your address at the network layer before a single line of
script runs, and if that address sits in a datacenter ASN, a perfect browser fingerprint
does not hide it. The browser cannot disguise the IP, by design, because the IP is not
a browser property.
So a headless host with a flawless desktop persona and a datacenter exit has fixed the
JavaScript tells and left the network tell standing. The fix is a residential or mobile
proxy that presents a clean address, passed on launch:
```python
proxy = {
"server": "socks5://gate.example.com:1080",
"username": "user",
"password": "pass",
}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com")
```
And the address is only the first of the things the browser does not fix. IP reputation,
per-account quotas, rate limits, and behaviour and timing are all supplied by you: a
clean exit, human pacing, and sane request volume. The [configuration page](configuration.md)
covers proxy schemes and how the browser timezone is auto-derived from the exit so the
two do not tell different stories, and the [Docker and container detection walkthrough](playwright-docker-detection.md)
covers the host-side tells in the order they usually bite.
## Conclusion
Can a website tell you are on a server? From the browser alone, it usually can, through
software WebGL, a missing audio device and headless screen metrics. A real-browser build
answers those as a desktop, on the browser side, regardless of the Linux or container host
underneath, which is why the JavaScript-visible surface stops giving the server away. What
it does not and cannot fix is the datacenter IP, which is read at the network layer and
needs a clean proxy, along with the account limits and pacing that no fingerprint touches.
Fix the machine tells with the browser, fix the address with the proxy, and pace the
behaviour yourself.
## Short answers to the questions that lead here
**Can a website detect a headless or server browser?** Often, from the machine rather
than the automation: a software WebGL renderer, no audio device, headless screen metrics,
and a datacenter IP.
**Does invisible_playwright hide that I am on a server?** It presents a real GPU, real
audio and Windows screen metrics on the browser side, so the JavaScript-visible tells look
like a desktop. It does not hide the exit IP, which is a network-layer signal.
**Is the datacenter IP a browser problem?** No. The address is read before any script runs,
so no browser can change it. That one needs a residential or mobile proxy.
**Why does a software renderer give me away?** Because a real desktop names a real GPU, and
`llvmpipe` or `SwiftShader` is a plain statement that there is no graphics hardware present.
**Do I still need a proxy if my fingerprint is perfect?** Yes, if the host is in a
datacenter. A flawless browser on a datacenter ASN is still on a datacenter ASN.
**Does this work the same in Docker as on a real machine?** The browser-side answers are
the same because the persona is presented by the browser, not read from the host. The IP
and the pacing still depend on where and how you run it.
## Sources
- This project's release gates, which read WebGL renderer, AudioContext output and screen
metrics through the shipped binary on a Linux host and compare them against a stock
desktop browser.
- The per-surface pages linked throughout, each read from its own detector's source rather
than from a rendered verdict.
**See also:** [Docker and container detection](playwright-docker-detection.md),
[WebGL renderer strings](webgl-renderer-strings.md), and
[screen size and other headless tells](screen-size-headless-tells.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. It fixes the machine tells a
server leaks in JavaScript; the datacenter IP and the pacing are still yours to supply.*
@@ -0,0 +1,202 @@
---
title: "Can I Use My Real Browser Profile With Playwright?"
description: "Playwright can point at a persistent profile, but reusing your daily browser leaks cookies and your machine fingerprint. Use a dedicated seed-fixed profile instead."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 24
---
# Can I Use My Real Browser Profile With Playwright?
Yes, technically. Playwright can launch against a [persistent user data
directory](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context),
and you can point it at the exact folder your everyday browser uses. The question is not
whether it works. It is whether you want the two things that come with it: your personal
cookies and history riding along in automated traffic, and whatever inconsistent
fingerprint your daily machine happens to have.
Both are avoidable, and the fix is not "no profile". It is "a different profile". This
page separates the good idea (a persistent profile) from the risky one (your personal
one), and shows a seed-fixed persistent context that keeps login state across runs
without carrying the host machine into every request.
## What people actually mean by "my real browser profile"
Two different wishes hide under the same sentence, and they have different answers.
The first is "I do not want to log in on every run." That is a reasonable and common
need, and a persistent profile is the right tool for it: cookies, local storage and
login state survive between sessions instead of starting empty each time.
The second is "I want to reuse the profile I browse with personally, because it is
already logged in and already looks real." That is where it goes wrong. Your daily
profile is full of your own cookies, your own history and consent decisions tied to
your own identity, and none of that belongs in an automated session. It also inherits
the fingerprint of the machine it launches on, which is a separate problem covered
below.
You want the first wish granted and the second one declined.
## Why your personal profile is the wrong choice
Two independent reasons, and either one is enough on its own.
**It mixes your identity into automated traffic.** Every cookie, every stored session,
every site that recognises you is now attached to whatever the automation does. If the
automated session is flagged, throttled or challenged, it is your account that carries
the record, not a disposable one. Linkability runs both directions: the profile links
your automation to you, and links you to your automation.
**A stock profile carries whatever fingerprint the launching machine has.** This is the
part most people miss. A plain profile does not standardise the machine underneath it.
It reports the real GPU, the real fonts, the real screen and audio devices of wherever
it runs. On your laptop that is your laptop. On a server it is a server with no GPU, no
fonts and a screen size nobody has, which is [what actually gets a datacenter session
detected](playwright-detected-as-bot.md), independent of any automation flag. Reusing
your personal profile does not fix that. It just picks one specific inconsistent machine
to leak.
The durable pattern is a dedicated profile whose identity you control, not the one you
read your email with.
## The pattern that works: a dedicated, seed-fixed profile
invisible_playwright takes a persistent profile directory the same way plain Playwright
does, through `profile_dir`. The difference is what fills in the machine. Instead of the
host's real hardware, the fingerprint is derived from a seed, so the same seed produces
the same coherent Windows browser every run: same GPU, same fonts, same screen, same
audio context. Cookies and login state accumulate in the directory across runs; the
machine stays a stable, real-looking Windows instance regardless of what the host
actually is.
The launch is two lines over plain Playwright, and everything after it is stock
Playwright:
```python
from invisible_playwright import InvisiblePlaywright
# one directory, one seed, paired for good
with InvisiblePlaywright(seed=42, profile_dir="/profiles/identity-42") as browser:
page = browser.new_page()
page.goto("https://example.com/account")
# first run: log in here. the directory keeps the session.
# later runs on the same seed + directory: already logged in.
```
The `browser` object is a real Playwright `Browser`, so `new_page`, `goto`, `click`,
`fill` and every other documented method work exactly as upstream. There is no wrapped
subset to learn. Add a proxy and a timezone the same way [Configuration](configuration.md)
describes, and the identity is complete: a logged-in session, on a consistent machine,
behind the exit you chose.
The pairing is the rule to hold onto: one directory belongs to one seed, permanently. A
stable directory with a changing seed describes a browser whose history spans weeks and
whose graphics card changed overnight, which is exactly the contradiction [a persistent
profile can create if you let the seed drift](persistent-profiles.md).
## Reproduce a run, and pin what has to stay fixed
The reason a fixed seed matters for a login profile is not only realism. It is
debuggability. If every run drew a fresh machine, a failing run would tell you nothing:
you could not separate the site changing from the fingerprint changing. Log the seed
once and a failure becomes reproducible.
```python
sf = InvisiblePlaywright(profile_dir="/profiles/identity-99")
with sf as browser:
print("seed =", sf.seed) # write this down next to the directory
page = browser.new_page()
page.goto("https://example.com")
```
Record the seed beside the directory name, because the folder outlives your memory of
which number produced it. If one specific field has to hold constant across identities
for reasons of your own, [pin that field](pinning.md) and leave the rest seed-derived
rather than reusing a whole personal profile to get it.
## The honest caveat: what a profile does and does not buy you
A dedicated seed-fixed profile preserves session trust. It does not launder anything
else, and it is worth being precise about the boundary.
What it fixes: the "no history" problem. The session looks like it has been used, stays
logged in, and does not reset to a blank browser every run. What it does not touch:
- **IP reputation.** The profile says nothing about your exit. A perfect logged-in
identity on a known datacenter address is still on a known datacenter address. Supply a
clean proxy; the profile does not.
- **Per-account limits and quotas.** A site that caps actions per account still caps
them. A reused session does not raise the ceiling, and hammering it from one session is
the surest way to spend the account.
- **Rate limits and timing.** Behaviour and pacing are yours to supply. The engine makes
the browser look real; it does not make a burst of requests look human. That is a
[session-reuse-versus-relogin tradeoff](automating-login-vs-session-reuse.md) and a
pacing decision, not a fingerprint one.
invisible_playwright is built to look like a real browser driven by a real person, which
is why the fingerprint, TLS and driver layers read as a genuine Firefox and pass most
in-page detection. That is a real and useful thing. It is not the same as evading every
control, and a profile does not change where that line sits. The reader still brings the
clean exit and the human pacing.
## Conclusion
Can you use your real browser profile with Playwright? You can, and you should not. The
part you want, staying logged in, comes from any persistent profile. The part you do not
want, your personal cookies and one specific leaky machine in every request, is exactly
what reusing your daily profile adds.
Point automation at a dedicated directory, pair it permanently with one seed so the
machine underneath stays a coherent Windows browser instead of the host, and log the
seed so a bad run is reproducible. Then remember what the profile is not: it keeps the
session, and it leaves the IP, the quotas and the pacing to you.
## Short answers to the questions that lead here
**Can Playwright use an existing browser profile?** Yes, through a persistent user data
directory. The mechanism is fine. Reusing the profile you personally browse with is the
part to avoid.
**Why not just point it at my normal Chrome or Firefox profile?** Because it drags your
personal cookies and history into automated traffic and inherits the launching machine's
fingerprint, including a server's missing GPU and fonts.
**Does a persistent profile keep me logged in between runs?** Yes. Cookies and login
state live in the directory and survive across sessions, as long as one directory maps
to one seed and is never shared between concurrent runs.
**Does reusing a profile make me undetectable?** No. It fixes having no history and
nothing else. The machine, the exit IP, the account quotas and your timing are all
separate, and a profile touches none of them.
**Do I need a new seed for each profile?** Yes, a distinct seed per profile, and the
same seed every time for a given profile. The seed is the machine; the directory is the
history.
**Will a dedicated profile fix a blocked datacenter IP?** No. Session trust and IP
reputation are unrelated. A logged-in identity on a flagged address is still on a flagged
address; that needs a clean exit, not a profile.
## Sources
- Playwright's own [`launch_persistent_context`
documentation](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch-persistent-context),
which defines the user data directory mechanism this page builds on.
- This project's persistent-context handling and the seed-to-fingerprint derivation
described across these docs, including the seed and `profile_dir` pairing.
- The detection ordering in the companion checklist, where machine tells outrank
automation tells and the exit IP is a separate axis from the browser.
**See also:** [what a persistent profile fixes and breaks](persistent-profiles.md) for
the traps that come with the directory, [automating the login versus reusing a
session](automating-login-vs-session-reuse.md) for the tradeoff behind staying logged
in, and [scraping behind a login with Playwright](how-to-scrape-behind-login-playwright.md)
for the end-to-end version of this.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The seed-and-directory
pairing rule is one I wrote down after debugging a profile whose machine changed
overnight.*
@@ -0,0 +1,195 @@
---
title: "Can two devices share a browser fingerprint?"
description: "Yes - that's the goal: a shared browser fingerprint hides you among real users, while a unique one is trackable. How anonymity sets work and how to land in one."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 26
---
# Can two devices share a browser fingerprint?
Yes, two devices can present the same browser fingerprint, and if your goal is not to
be followed around, that is the outcome you want rather than the one to avoid.
The intuition most people bring to this is backwards. It feels like a fingerprint should
be unique, like a real one, and that a collision is a failure. For tracking it is the
opposite: a fingerprint that only you have is a fingerprint that follows only you. A
fingerprint that thousands of real people also have tells a tracker almost nothing about
which of them you are.
This page is about that trade, why a common configuration beats a clever one, and how to
land on a shared-looking identity on purpose instead of by luck.
## The anonymity set is the whole game
A browser fingerprint is not one value. It is a hash of many components read from
JavaScript: the GPU string, the canvas and audio outputs, the installed fonts, the
screen geometry, the platform, the language list, and dozens more. [FingerprintJS calls
the resulting hash a visitor ID](fingerprintjs-visitor-id.md), and its job is to
recognise you again on the next visit.
The number that decides whether it can is the size of the group that shares your value.
This group is the anonymity set. If ten thousand other browsers produce exactly your
hash, the visitor ID identifies a crowd, not you, and the tracker has to fall back on
other signals to tell you apart. If your hash is unique, the visitor ID identifies you
and only you, and it will do so every session until one of those components changes.
So the useful question is not "is my fingerprint unique". Uniqueness is the failure mode.
The useful question is "how many real people look exactly like this", and you want that
number large.
A one-of-a-kind fingerprint loses this even when every individual value is plausible. A
GPU nobody else reports, a screen size nobody else has, a font set assembled by no real
installer: each looks fine alone and, taken together, marks one browser out of everyone.
That is why [pinning fields by hand is risky](pinning.md) unless you know the
combination is one real machines actually ship.
## Why a common configuration beats a clever one
The instinct to look special is exactly the wrong instinct here.
Trackers do not need to prove you are automated to follow you. They only need your
combination of values to be rare. Rarity is the signal, and it does not care whether the
values are suspicious. A perfectly innocent, perfectly consistent, perfectly unique
browser is perfectly trackable.
So the design target is the boring middle of the distribution: a Windows version many
people run, a GPU many people have, a screen size that sits on a common laptop panel, a
language list a large population shares. Land there and you disappear into a group. Land
on the tails, even with clean values, and you stand out by being precise.
This is also why "resist fingerprinting" and "blend into a crowd" are two different
strategies that can conflict. The browser's own
[resistFingerprinting mode](resist-fingerprinting.md) makes many browsers report the same
flattened values, which is one way to build an anonymity set, but the set it puts you in
is the set of people who turned that mode on, and that set has its own recognisable shape.
Blending in with the general population is a different bet: look like the common case, not
like the privacy case.
## How a seed lands you in a crowd
invisible_playwright generates each identity to look like a common, real-world Windows
machine rather than a rare or unusual one, because a configuration many genuine users
also present blends in, while a one-of-a-kind combination stands out and is trackable.
The GPU string, the renderer, and the capability limits it reports are chosen together
and cross-checked, so
[the WebGL parameters agree with each other](webgl-parameters-are-identical.md) the way a
real driver's do rather than being mixed from different machines.
Switching from stock Playwright is two lines, and the identity is generated for you:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright() as browser:
page = browser.new_page()
page.goto("https://example.com")
```
Pass a seed and every field it implies comes back identical, run after run, so you can
inspect the exact identity a seed produces and reuse it:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# same GPU, same canvas hash, same fonts, same screen, every run
```
The `browser` returned is a real Playwright `Browser`. Every method works exactly as
documented upstream; there is no reduced API to learn.
Two different seeds give two different plausible identities, and because each is
generated to be a common real-world configuration, both can land in a well-populated
part of the space.
That is the sense in which two of your own devices can "share" a look: not that they hash
to the same value by accident, but that each is a common configuration, and common
configurations are shared by construction with the real population.
## The caveat: fingerprint is not the only thing matched
Blending in on fingerprint does not blend in everything, and this is the honest limit of
what any fingerprint layer can do.
A browser identity that looks like a common real machine is why invisible_playwright
passes most in-page detection: the fingerprint, the TLS handshake and the driver layer
read as a genuine Firefox rather than an automated one. That is a real and load-bearing
result. It is also only one of the axes a serious system matches on, and the others are
matched separately:
- **Your IP address.** A crowd-blending fingerprint on a datacenter address, or on a
proxy IP that is already known and shared by a thousand scrapers this minute, is
singled out by the address alone. Fingerprint collisions do not help you here; supply a
clean exit yourself.
- **Your request pattern.** Rate, timing, the order you touch pages, per-account quotas.
A hundred sessions that each look like a different real person, all arriving in the same
ten seconds from the same place, are a pattern no fingerprint hides. Human pacing is
yours to supply.
- **The story your surfaces tell together.** A common browser fingerprint with a timezone
or language that contradicts the exit IP is not blended in, it is inconsistent, and
[a timezone that does not match the proxy](timezone-proxy-mismatch.md) is one of the
most common self-inflicted versions of this.
So the accurate claim is narrow and worth stating plainly: a shared, common fingerprint
helps you avoid being tracked and identified by fingerprint. It does nothing for IP
reputation, quotas, rate limits, or behaviour. Those are matched on their own, they can
single you out on their own, and the reader supplies the clean proxy and the human pacing
that address them. Anyone promising that one browser makes a session undetectable is
selling the part that does not exist.
## Conclusion
Two devices sharing a browser fingerprint is not a bug, it is the objective. Uniqueness
is what makes a browser trackable across sessions; membership in a large group of
look-alike real users is what makes it hard to follow. Sampling common, cross-checked
real-world configurations lands you in that group on purpose. Then pair it with an
address and a rhythm that fit the same story, because fingerprint blending buys you the
fingerprint axis and only that one.
## Short answers to the questions that lead here
**Can two devices have the same browser fingerprint?** Yes. Many components are shared by
large populations, so identical hashes across devices are normal, and for anti-tracking
they are what you want.
**Is a unique fingerprint good or bad?** Bad, if you do not want to be followed. Unique
means recognisable on every future visit. Common means lost in a crowd.
**Does sharing a fingerprint make me anonymous?** On the fingerprint axis it hides you in
a group. It does nothing about your IP address or your request pattern, which are matched
separately and can identify you on their own.
**Why does invisible_playwright aim for a common configuration instead of a rare one?**
Because rarity is the tracking signal. A configuration many real users also present puts
you in a large anonymity set instead of marking you out.
**If I pass the same seed on two machines, do they look identical?** Yes. The same seed
produces the same GPU, canvas, audio, fonts and screen, which is deliberate: it makes a
run reproducible and lets two devices present the same known-good identity.
**Will a good fingerprint alone stop me from being blocked?** No. It handles the
fingerprint, TLS and driver layers. A datacenter IP or a robotic request pattern is still
a datacenter IP or a robotic pattern, and you supply the clean exit and the human pacing.
## Sources
- The FingerprintJS open-source library's visitor ID model, read from its own source, for
how many components combine into one recognisable hash.
- This project's approach of generating common, real-world Windows and GPU
configurations rather than unique ones, and its cross-checking of GPU string, renderer
and capability limits against each other.
- This project's release gates, which separate fingerprint realness from IP and request
signals precisely because a clean fingerprint does not clear the other two.
**See also:** [what a FingerprintJS visitor ID actually measures](fingerprintjs-visitor-id.md),
[why the WebGL parameters have to agree with each other](webgl-parameters-are-identical.md),
and [when the timezone does not match the proxy](timezone-proxy-mismatch.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The anonymity-set framing
is the one that keeps me from "fixing" a shared fingerprint that was doing its job.*
@@ -0,0 +1,192 @@
---
title: "Can websites detect a datacenter or proxy IP?"
description: "Yes, directly at the network layer. No fingerprint can hide the IP the connection arrives on. Why fingerprint and IP layers are independent and both must be right."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 16
---
# Can websites detect a datacenter or proxy IP?
Yes, directly. The server sees the address your connection arrives on before a
single line of your JavaScript runs, and it can look that address up: which
network owns it, whether it belongs to a hosting provider or a home broadband
line, and whether it has been abused recently. No browser fingerprint changes
that lookup, because the address is a property of the connection, not of the
page.
This is the honest boundary of any browser-side stealth. A tool like
invisible_playwright makes the browser look like a real person's, and that is
most of what public detection checks read. It does not, and cannot, change the
reputation of the IP you route through. Those are two independent layers, and
both have to be right.
## What the server reads before your page loads
Every request carries a source IP. From that one number the receiving server
derives, with no cooperation from you:
- **The ASN**, the [autonomous system number](https://datatracker.ietf.org/doc/html/rfc1930),
which identifies the network that owns the address block. Hosting and cloud
providers have their own ASNs, and they are trivially separable from
consumer broadband and mobile carriers.
- **The address type**, datacenter versus residential versus mobile, which
public and commercial datasets label directly.
- **Reputation**, meaning whether this address or its neighbours have recently
sent traffic that looked automated or abusive. Shared and heavily recycled
exits accumulate this quickly.
None of that is a browser property. It is decided at the network layer, the same
layer that carries the [TLS handshake no in-page test can see](how-to-test-bot-detection.md).
A perfect fingerprint sitting on an address the server already distrusts is a
consistent browser on a flagged IP, and the flag wins.
## Why the fingerprint cannot reach it
The fingerprint cannot reach the IP because the two are different kinds of
value: the fingerprint is data the browser volunteers to the page, and the IP
is decided by the network carrying the connection, which the page never
touches.
A fingerprint is everything the page can measure about the client from inside
the sandbox: the user agent, the GPU string, the canvas and audio hashes, the
font list, the screen, the language settings. All of it is data the browser
volunteers in response to JavaScript. That is exactly why it is spoofable, and
why matching it to a real Windows machine is worth doing.
The IP is the opposite kind of value. It is not something the browser reports;
it is where the packets came from. The browser cannot lie about it because the
browser is not the one telling the server. The network is. You can change which
IP you arrive on by routing through a different proxy, but you cannot make a
given IP read as something it is not, and no amount of in-page patching touches
it. This is the single most common misunderstanding about stealth: people expect
a good fingerprint to cover the address, and the two never meet.
## Both layers, independently, with the real API
Because the layers are independent, you supply the IP and the tool supplies the
browser. The proxy is passed at launch, and everything downstream is stock
Playwright:
```python
from invisible_playwright import InvisiblePlaywright
proxy = {
"server": "socks5://gate.example.com:1080",
"username": "user",
"password": "pass",
}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com/")
print(page.title())
```
Two things are happening here, and they are separate. `seed=42` fixes the
browser half: the same GPU, canvas hash, audio context, fonts and screen every
run, so a failure is reproducible. `proxy=...` fixes the IP half: every request,
including DNS, leaves through that exit. The `browser` object is a real
Playwright [`Browser`](https://playwright.dev/python/docs/api/class-browser), so
`new_page`, `goto`, `click` and the rest behave exactly as documented upstream.
By default, with no `timezone=` argument, the browser timezone is derived from
the exit IP so the two stories agree. If you want to confirm the exit is what you
think it is, read it from inside the browser rather than assuming, and check that
[WebRTC is not reporting a second address next to the proxy's](how-to-check-proxy-ip-leak.md).
## Choosing the IP half so it does not undo the browser half
The fingerprint work is wasted if the address is one a server distrusts on sight.
Two rules follow directly from what the server reads:
- **Type matters more than count.** A residential or mobile exit shares an ASN
and an address type with ordinary human traffic; a datacenter exit does not,
no matter how many of them you rotate through. Rotation does not change the
type.
- **Freshness matters as much as type.** A large share of cheaply available
proxies are already public, which means their addresses are already on the
lists servers consult, and they were flagged before you ever used them. The
distinction between a clean exit and a burned one is not price, it is whether
the address is already known. The tradeoffs between exit protocols are covered
in [SOCKS5 versus HTTP proxies for a browser](socks5-vs-http-proxy-browser.md),
and the reputation problem itself in
[why scraping gets blocked even through a proxy](web-scraping-getting-blocked-proxies.md).
Get both halves right and the server sees a genuine Firefox arriving from an
address that looks like a person's. Get the browser right and the IP wrong, and
you have built a careful disguise and then signed it at the door.
## What this does and does not fix
To be explicit, because overclaiming here is both false and a real risk:
invisible_playwright is designed to look like a real browser driven by a real
person, and that is why it passes most fingerprint, TLS and driver-layer checks:
those layers read as a genuine Firefox. On its own it does not fix IP reputation,
per-account quotas, rate limits, or behaviour and timing. Those are yours to
supply: a clean exit for the address, human pacing for the behaviour, sane limits
for the account. There is no setting that makes an IP undetectable, because the
IP is not something the browser gets to describe.
## Conclusion
Can websites detect a datacenter or proxy IP? Yes, directly and early, at a layer
no fingerprint reaches. The browser fingerprint and the IP are independent
signals, read by different parts of the stack, and a detector that sees a perfect
browser on a flagged address believes the address. So match the browser, which is
what this tool does, and pair it with an exit whose type and reputation hold up,
which is what you bring. Neither half alone is a session; both right is.
## Short answers to the questions that lead here
**Can a browser fingerprint hide my IP?** No. The IP is where the connection
comes from, not something the browser reports, so no in-page value or spoof
changes it.
**Will a residential proxy alone get me through?** It fixes the address half. If
the browser still looks automated, a clean IP does not save it. Both layers have
to be right.
**How does a site know my IP is a datacenter?** From the ASN and address-type
datasets tied to the IP. Hosting networks have their own autonomous system
numbers and are labelled as such in public data.
**Does rotating IPs help?** It helps with rate limits and per-address velocity.
It does not change the type: rotating datacenter exits are still datacenter
exits.
**Can invisible_playwright change my ASN or reputation?** No, and nothing on the
browser side can. It handles the fingerprint, TLS and driver layers; you supply
the exit.
**Why do I pass every fingerprint test and still get blocked?** Because the
suites do not see your address, and a consistent browser on a distrusted IP is
still on a distrusted IP.
## Sources
- [RFC 1930](https://datatracker.ietf.org/doc/html/rfc1930), the IETF guidelines
that define an Autonomous System as a routing policy unit and specify the ASN
that identifies it.
- [Playwright's `Browser` class reference](https://playwright.dev/python/docs/api/class-browser),
for what the `browser` object in the example above exposes once the proxy is
wired in.
- This project's default behaviour: the proxy dict passed at launch routes every
request and its DNS through the exit, and the browser timezone is derived from
that exit unless an explicit zone is set.
- The [configuration notes](configuration.md) on proxy schemes and on why roughly
nine in ten cheap proxies are already known before first use.
- The [testing method page](how-to-test-bot-detection.md), which lists IP
reputation among the things no in-page suite covers.
**See also:** [the checklist for being detected on one site](playwright-detected-as-bot.md),
[how to check for a proxy IP leak](how-to-check-proxy-ip-leak.md), and
[when the timezone does not match the proxy](timezone-proxy-mismatch.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser half is
what the patch does; the IP half is the one honest thing it cannot do for you.*
+206
View File
@@ -0,0 +1,206 @@
---
title: "Can websites detect Playwright? What is actually visible"
description: "Stock Playwright exposes a webdriver flag, protocol artifacts and mismatched OS fingerprint. Which signals catch your run, and what a patched Firefox fixes."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 20
---
# Can websites detect Playwright? What is actually visible
Yes, in principle. Stock Playwright leaves signals in the page that a script can read,
and any one of them is enough to tell "this is automated" from "this is a person". But
"in principle" is doing real work in that sentence. Whether a given site catches your
specific run depends entirely on which of those signals it bothers to check, and there
are only a handful of them.
This page enumerates the concrete tells a page can read, maps each to what a real-looking
browser does about it, and shows the two-line launch that removes the browser-level ones.
It also states plainly what that launch does not touch, because a page that promised you
undetectability would be lying to you.
## The three signals a page can actually read
Strip away the folklore and stock Playwright exposes three families of tell to in-page
JavaScript:
- **A driver flag.** `navigator.webdriver` is defined by the
[WebDriver automation standard](https://www.w3.org/TR/webdriver2/), and a page reads it
with one property access.
- **Protocol and automation artifacts.** Globals left in scope by a stealth layer, a
built-in whose `toString()` no longer says `[native code]`, an event that arrives
without the trusted bit a real click carries.
- **A fingerprint that contradicts itself.** The user agent claims one operating system
while the GPU string, the font list, the audio device or the screen geometry describe a
headless machine somewhere else.
Everything a page-level bot check does falls into one of those three. The rest of this
article takes them one at a time.
## Signal one: the webdriver flag
The cheapest check there is. Under standard automation, `navigator.webdriver` returns
`true`, and a single line of page script reads it.
The naive fix makes things worse. Setting the property to `false` from a script is itself
a tell, because a genuine browser that was never automated reports `undefined`, not
`false`. A value where there should be an absence is a signature of its own. The correct
behaviour is the one an untouched browser produces, and getting there from JavaScript
patching is [harder than it looks](navigator-webdriver-explained.md).
invisible_playwright drives a Firefox patched at the C++ level, so the flag reports the
real-browser value without a script ever assigning it. There is no override to catch,
because nothing overrode anything.
## Signal two: automation globals and protocol artifacts
Automation globals and protocol artifacts are what the act of driving the browser leaves
lying around, and they exist whether or not the driver flag above was ever touched.
JavaScript stealth plugins reach into built-ins to hide the first signal, and in doing so
they create the second: a redefined function whose `toString()` stops returning
`[native code]`, a property descriptor that a real engine never has, a global that only a
particular tooling stack defines. A tampering-oriented suite such as CreepJS does not ask
what you report, it asks whether anything you report contradicts anything else, and a
built-in that has been rewritten is exactly that kind of contradiction. This is
[the native-code check](tostring-native-code-detection.md), and it is the reason stacking
two disguises reads worse than one.
Because the browser is patched in the engine rather than in the page, there are no
injected globals to enumerate and no rewritten built-ins to catch with `toString()`. The
functions a page inspects are the genuine ones.
## Signal three: a fingerprint that does not match the claimed OS
A fingerprint that contradicts the claimed operating system is the family that catches most
server-side automation, and it has nothing to do with the driver at all.
A page reads the user agent, then reads the GPU renderer string, the installed fonts, the
audio device parameters and the screen geometry, and checks that they tell the same story.
A headless machine in a datacenter usually fails that check without any automation flag
being set: a software renderer under a claim of desktop hardware, a font set that belongs
to a different operating system, an audio stack answering with defaults, a screen
resolution no real display has. None of those are automation tells. They are
"this is a datacenter" tells, and they survive every page-level patch because they are not
in JavaScript's gift to change.
invisible_playwright derives a complete, internally consistent fingerprint from a seed:
GPU, canvas, audio, fonts and screen, roughly 400 fields, generated to agree with each
other and to describe a real Windows desktop rather than the host the code runs on. Same
seed, same machine, every run, which is what makes a failure reproducible enough to bisect.
This is the family that a real-browser fingerprint fixes and a property patch cannot, and
it is why the launch below passes most JS detection: the driver layer, the fingerprint and
the TLS handshake all read as a genuine Firefox.
## The launch that removes the browser-level tells
Switching from stock Playwright is two lines, and the object you get back is a real
Playwright `Browser`, so every method you already use works unchanged.
```python
from invisible_playwright import InvisiblePlaywright
# seed=42 makes the identity reproducible; drop it for a fresh one each run
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# navigator.webdriver reads as a real browser; the fingerprint is consistent
print(page.evaluate("navigator.webdriver"))
```
Add a proxy when you deploy, since the browser-level tells are only half the picture:
```python
from invisible_playwright import InvisiblePlaywright
proxy = {"server": "socks5://gate.example.com:1080", "username": "u", "password": "p"}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com")
```
The async API is identical, `from invisible_playwright.async_api import InvisiblePlaywright`
with `await` in front of the page calls. Nothing else about your Playwright code changes.
## What this does not fix, and why saying so matters
Here is the honest boundary, because a tool that removed only some of the signals and let
you believe it removed all of them would get you blocked with more confidence, not less.
The launch above addresses the three browser-level families: the driver flag, the
automation artifacts and the fingerprint, plus the TLS handshake, because the request is
made by a real Firefox rather than something impersonating one. What it does not touch:
- **IP reputation.** A consistent browser on a known datacenter address is still on a
known datacenter address. You supply a clean exit.
- **Per-account quotas and rate limits.** A perfect fingerprint does not raise a limit the
account already hit.
- **Behaviour and timing.** A burst of identical requests, a form filled in eighty
milliseconds, a session with no pointer motion. Some sites do not fingerprint at all,
they watch, and pacing is on you.
So the accurate claim is narrow and true: invisible_playwright makes the browser read as a
real one, which is why it passes most in-page detection. It does not make the session
invulnerable, and no software can, because half the signals are about the network and the
account rather than the browser. When a run still fails with all three browser families
clean, the [checklist for being detected on one site](playwright-detected-as-bot.md) works
the remaining suspects in the cheap-first order, and the network layer has
[its own page on the handshake](ja3-ja4-tls-fingerprint.md).
## Conclusion
Can websites detect Playwright? They can detect stock Playwright whenever they check for
one of three things: the webdriver flag, automation artifacts, or a fingerprint that
disagrees with the claimed OS. A patched Firefox driven by stock Playwright removes all
three at the engine level, which is why it clears most JavaScript detection. It does
nothing for your IP, your quotas or your pacing, so the honest answer to the title is that
it fixes the browser and leaves the rest to you. Verify it the way you would verify
anything here: [compare against a stock browser and run it more than once](how-to-test-bot-detection.md).
## Short answers to the questions that lead here
**Can a website tell I am using Playwright?** If it checks the webdriver flag, automation
artifacts or fingerprint consistency, yes for stock Playwright. A patched-engine browser
removes those browser-level tells.
**Does invisible_playwright make me undetectable?** No, and nothing does. It makes the
browser read as a real Firefox, which passes most in-page checks. Your IP, account limits
and behaviour are separate and still yours to handle.
**Is navigator.webdriver enough to catch me?** It is the cheapest check and stock
automation fails it. Setting it to `false` in a script is its own tell; a real browser
reports `undefined`.
**Why do I pass fingerprint tests and still get blocked?** Because those tests do not see
your address, your request rate or your timing, and a consistent browser on a datacenter
IP is still on a datacenter IP.
**Do stealth plugins help?** They fix the first signal and often create the second: a
rewritten built-in that a tampering check flags. Running one on top of a patched engine is
two disguises contradicting each other.
**How do I check what a site actually reads?** Open a detection suite in your automated
browser and a stock browser on the same machine, and diff the reports field by field
rather than reading the score.
## Sources
- The [W3C WebDriver specification](https://www.w3.org/TR/webdriver2/), which defines the
`navigator.webdriver` property and the automation flag behind it.
- This project's real API surface, `InvisiblePlaywright(seed=...)` and the returned
Playwright `Browser`, as documented in the quickstart and configuration pages.
- The public detection suites CreepJS, BotD, FingerprintJS, sannysoft and BrowserLeaks,
each of which reads one or more of the three signal families described above.
- This project's release gates, which assert the presence of a real-browser signal rather
than the absence of a wrong one, and separate browser tells from IP and behaviour.
**See also:** [the webdriver flag in detail](navigator-webdriver-explained.md),
[the checklist for a single blocking site](playwright-detected-as-bot.md), and
[how to test whether your browser is detected](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The honest boundary in the
last section is the one I most wish more of these pages drew.*
@@ -0,0 +1,208 @@
---
title: "Can you be fingerprinted in incognito mode?"
description: "Yes: incognito mode clears cookies and site storage but leaves canvas, WebGL, fonts, user agent, timezone and the TLS handshake fully readable and re-linkable."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 23
---
# Can you be fingerprinted in incognito mode?
Yes. This is the single most common misunderstanding about private browsing, and it is
worth stating plainly before the details: incognito mode clears **state**, not
**identity**. It empties cookies and site storage at the end of a session. It does not
change what your browser looks like while the session is running, and that is exactly
the part fingerprinting reads.
This page is what private mode actually does, why stateless fingerprinting is untouched
by it, how a service re-links you across incognito windows anyway, and what changing the
fingerprint values themselves looks like in practice.
## What private mode actually clears
Open a private window and the browser makes one promise: when you close it, the cookies,
`localStorage`, `sessionStorage`, IndexedDB and cache from that session go away. History
is not written to disk. That is the whole feature, and for its intended purpose (a shared
family computer, not leaving a booking half-finished in your history) it does that job.
Notice what is on that list: all of it is **state the site wrote to your machine**. A
cookie is a value the server set and asked you to hand back. Private mode's guarantee is
that you stop handing those back once the window closes.
Nothing on that list is a property of the browser itself. And identification does not
need you to hand anything back.
## Why stateless fingerprinting does not care
A cookie is something you were **given**. A fingerprint is something you **are**. Private
mode only deletes the first kind.
When a page measures your browser, it reads values the browser exposes on request, no
storage involved:
- **Canvas.** The page draws text and shapes to an offscreen canvas and
[reads the pixels back](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)
as an encoded image. The exact bytes depend on your GPU, drivers and font rasterizer, and
they are identical in a private window because it is the same GPU. See
[why canvas output can change every run](canvas-fingerprint-changes-every-run.md) for
what a real defense against this looks like.
- **WebGL.** The
[renderer and vendor string](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info)
and the numeric limits of your graphics stack. Same machine, same values, private or not.
- **Fonts.** The list of installed fonts, measured by rendering and comparing widths. A
private window renders with the same fonts.
- **User agent, platform, language, timezone.** All reported the same way in incognito.
- **The [TLS handshake](https://datatracker.ietf.org/doc/html/rfc8446).** Decided by the
network stack before a single line of page JavaScript runs, so no browsing mode touches
it. [No in-page test can even see it](ja3-ja4-tls-fingerprint.md), and neither can
incognito.
Read that list again against the previous section. There is no overlap. Private mode
clears cookies and storage; fingerprinting reads GPU, fonts, TLS and the rest. The two
sets do not intersect, which is why a fingerprint survives the mode that was supposed to
protect it.
## How you get re-linked across incognito windows
Here is the part that surprises people. Because the fingerprint is stable and does not
depend on stored state, a service can compute the same identifier in a normal window, in
a private window, and in a second private window you opened an hour later to "start
fresh". [FingerprintJS builds exactly this kind of visitor ID](fingerprintjs-visitor-id.md)
by hashing many of those stateless components together.
So the common workflow of "open an incognito window to look like a new visitor" does not
produce a new visitor. It produces the same visitor with an empty cookie jar. The site
sets a fresh cookie, ties it to the fingerprint it just computed, and the link is
restored on the first request. Clearing the cookie deleted the label on the folder, not
the folder.
This is not a bug in private mode. Private mode never promised a new identity. It
promised no leftover state, and it delivers that.
## Changing the values themselves, not clearing storage
If the problem is that the fingerprint values are stable and readable, the fix is to
change the values, which is the specific thing private mode does not do. That is what
invisible_playwright does: a Firefox patched at the C++ level so that canvas, WebGL,
fonts, screen and the rest report seed-derived values, driven by stock Playwright.
Two lines to launch, and the browser you get back is a real Playwright
[`Browser`](https://playwright.dev/python/docs/api/class-browser) with every standard
method:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# canvas, WebGL, fonts, screen all report seed-42 values,
# not this machine's values
```
The seed is the whole point. The same seed produces the same coherent identity every
run, and a different seed produces a different one. So where private mode gives you the
same machine with its storage wiped, a new seed gives you a genuinely different machine
that happens to be internally consistent:
```python
# a different, self-consistent identity - a different GPU, fonts, canvas hash
with InvisiblePlaywright(seed=7) as browser:
page = browser.new_page()
page.goto("https://example.com")
```
You can prove the difference to yourself. Open a public fingerprinting suite with
`seed=42`, note the visitor ID or the canvas hash, close it, reopen with `seed=42`, and
it matches. Change to `seed=7` and it moves. That is the value changing, which is the
axis incognito leaves fixed. For the Firefox `about:config` route to the neighbouring
problem, [`privacy.resistFingerprinting` and what it trades away](resist-fingerprinting.md)
is worth reading before you reach for it.
## The honest caveat: it does not change your IP
There is one thing this shares with private mode: neither touches your IP address.
Incognito does nothing for your address, and neither does changing the fingerprint. Your
exit IP, its reputation, and the ASN it sits in are all still exactly what they were.
This matters because a perfect, distinct, self-consistent browser on a datacenter IP that
a thousand other automated sessions are using this minute is still on that IP. The
fingerprint and the driver layer reading as a genuine Firefox is why most detection
checks pass; it is not why a session passes. The reader supplies the rest:
- **A clean exit.** The fingerprint work is wasted behind an address already on a
blocklist. See [Configuration](configuration.md) for proxy setup.
- **Human pacing and behaviour.** Timing, pointer motion and typing rhythm are a separate
surface that no fingerprint change addresses.
- **Per-account quotas and rate limits.** A new fingerprint is not a new account, and it
does not reset a counter the service keeps on its own side.
Changing the fingerprint fixes the fingerprint. It does not fix the network or the
behaviour, and claiming otherwise would be false.
## Conclusion
Can you be fingerprinted in incognito mode? Yes, identically to a normal window, because
private mode clears the cookies and storage a site wrote to your machine and leaves every
readable property of the browser (canvas, WebGL, fonts, user agent, timezone, TLS)
exactly where it was. Stateless fingerprinting reads those properties, so it works the
same in either mode, and a service can re-link you across incognito windows on the
fingerprint alone.
Changing the values themselves is a different operation from clearing state, and it is
the one incognito does not perform. invisible_playwright performs it per seed, so the
same input gives the same consistent identity and a new input gives a new one. Pair that
with a clean exit and human pacing, because the fingerprint is only one of the surfaces a
session is judged on.
## Short answers to the questions that lead here
**Does incognito mode stop fingerprinting?** No. It clears cookies and site storage at
the end of the session and changes nothing about canvas, WebGL, fonts, user agent,
timezone or TLS, which are what fingerprinting reads.
**Can a site tell it is the same person across two incognito windows?** Yes. The
fingerprint is stable and does not depend on stored state, so the same identifier is
computed in each window and the empty cookie jar is refilled and re-linked on the first
request.
**What does private mode actually protect me from?** Leaving state behind on the machine:
history, cookies and cache from that session. That is a real feature, just not an
anti-fingerprinting one.
**Does incognito change my IP address?** No, and neither does changing the fingerprint.
The exit IP and its reputation are a separate surface you have to handle yourself.
**How do I actually get a different fingerprint?** Change the values the browser reports
rather than clearing what a site stored. invisible_playwright does this per seed, so a
new seed is a new coherent identity.
**Is a new seed the same as a new incognito window?** No. An incognito window is the same
machine with its storage wiped. A new seed is a different machine, self-consistent across
its fields.
## Sources
- Firefox's own documentation of what private browsing clears (cookies, storage, history)
and, by omission, what it does not.
- The specs behind each stateless signal above:
[`HTMLCanvasElement.toDataURL()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)
for the canvas read-back, [`WEBGL_debug_renderer_info`](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info)
for the GPU renderer/vendor string, and [RFC 8446](https://datatracker.ietf.org/doc/html/rfc8446)
for where the TLS handshake sits relative to page JavaScript.
- The public detection suites named in this set, read for how each computes an identifier
from stateless components, each with its own page here.
- This project's seed-to-fingerprint pipeline and release gates, which measure the same
seed producing the same identity across runs.
**See also:** [how a stable visitor ID is built](fingerprintjs-visitor-id.md),
[what canvas fingerprinting reads and how to change it](canvas-fingerprint-changes-every-run.md),
and [the TLS handshake no browsing mode can hide](ja3-ja4-tls-fingerprint.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. Private mode clears what a
site stored on you; this project changes what the browser is, which is the axis private
mode leaves alone.*
@@ -0,0 +1,212 @@
---
title: "Can you run invisible_playwright serverless?"
description: "Why invisible_playwright mostly does not fit serverless: size of patched-Firefox is the blocker. Containers and long-lived workers are the actual home."
parent: "Scraping with Playwright"
grand_parent: "Guides"
nav_order: 84
---
# Can you run invisible_playwright serverless?
Mostly no, and for a structural reason rather than a setting you have not found yet.
The blocker is not a config flag. It is that this tool launches a full, real browser,
and a serverless function is sized for code that does not.
This page is the mechanism behind that answer, the one place it does fit, and the
container or long-lived worker that is the honest recommendation instead.
## The short answer, and why it is structural
invisible_playwright is not a JavaScript shim that patches an existing browser. It ships
a patched Firefox, built at the C++ level, and drives it with stock Playwright. On first
use it downloads that binary (about 238 MB compressed, roughly 544 MB once unpacked, as
listed on the [installation](installation.md) page), verifies a sha256, and caches it.
A real launch then needs that unpacked tree on disk plus working memory for the browser
process itself.
A typical function-as-a-service runtime caps three things at once: deployment package
size, memory, and wall-clock execution time. All three fight a cold-start browser
launch. The download alone can exceed a package limit; the unpacked tree plus a running
Firefox can exceed the memory limit; and downloading and starting a browser per
invocation can exceed the time limit before your first `goto` returns.
So the answer is not "add a bigger timeout". The weight of a real browser is the thing
that does not fit, and no configuration removes it.
## What a function actually has to do to launch this
Walk through a cold invocation of a function that has never run before:
1. Fetch the engine. If it is not baked into the image, that is a ~238 MB download on
the critical path, before any of your code runs.
2. Unpack and place it. Roughly 544 MB has to land somewhere writable and readable.
3. Verify it. A sha256 pass over the cached engine.
4. Launch Firefox and connect Playwright over its protocol.
5. Only now open a page and do the work you came for.
Steps 1 through 4 are pure overhead, and on a serverless platform they can repeat on
every cold start because the local disk and memory a function sees do not persist between
invocations by design. You are paying browser-startup cost per request instead of once.
## Where the weight goes: download, unpack, and resident memory
Three separate limits, three separate ways this fails:
- **Package or layer size.** Many function platforms cap the deployed artifact well
under the unpacked engine size. Baking Firefox into the deployment can blow past the
limit outright.
- **Ephemeral disk.** The engine has to be unpacked somewhere. A read-only or tiny
scratch filesystem cannot hold it.
- **Memory.** A real Firefox rendering a real page has a real resident-set size. Add the
unpacked binary in page cache and a modest function memory tier is gone.
The download can be moved off the critical path with a cache directory, and the wrapper
supports exactly that: `INVISIBLE_PLAYWRIGHT_CACHE_DIR` points the engine at a path your
platform already caches between runs, and `INVPW_BINARY_PATH` skips the download entirely
when a compatible binary is already on disk (see [Configuration](configuration.md)). That
helps a persistent worker a great deal. It helps a stateless function much less, because
the thing a function does not keep is exactly the local disk those variables point at.
## The recommendation: a container image or a long-lived worker
The honest home for this tool is somewhere the browser is unpacked once and reused across
many jobs:
- **A container image** with the engine already inside it, run on a service that keeps
the container warm. The unpack happens at build time, not per request. This is common
enough to have its own walkthrough in
[how to use invisible_playwright in Docker](how-to-use-invisible-playwright-in-docker.md),
and the fingerprint pitfalls specific to containers are in
[running Playwright in Docker undetected](how-to-run-playwright-docker-undetected.md).
- **A long-lived worker or VM** that launches the browser once at startup and pulls jobs
from a queue, reusing the same process across many pages.
Both share one property that a stateless function cannot: the ~238 MB download and the
~544 MB unpack are paid once, at startup or build, and every job after that reuses a warm
browser. That is the difference between browser cost per deployment and browser cost per
request.
Here is a minimal worker that launches once and reuses the browser across a list of jobs.
The `browser` returned is a real Playwright
[`Browser`](https://playwright.dev/python/docs/api/class-browser), so every method is the
stock API:
```python
from invisible_playwright import InvisiblePlaywright
JOBS = [
"https://example.com/a",
"https://example.com/b",
"https://example.com/c",
]
# seed=42 makes the identity reproducible, so a failing job replays exactly.
with InvisiblePlaywright(seed=42) as browser: # binary unpacked once, reused below
for url in JOBS:
page = browser.new_page()
page.goto(url)
print(url, page.title())
page.close()
```
In a real worker the `for` loop is a queue consumer, and the `with` block stays open for
the life of the process. The launch cost is amortized across every job the worker ever
handles, which is the whole point of not being serverless.
If you must fetch the engine ahead of time in an image build, do it as an explicit build
step so the download never lands on a request path:
```dockerfile
FROM python:3.12-slim
RUN pip install invisible-playwright
# Unpack the engine at BUILD time, not per request.
RUN python -m invisible_playwright fetch
# ... your worker entrypoint ...
```
## What the stealth actually does for you here, and what it does not
invisible_playwright is designed to look like a real browser driven by a real person, and
that is why it passes most detection checks: the fingerprint, the TLS handshake and the
driver layer read as a genuine Firefox rather than as automation. That property is the
same whether the browser runs in a function, a container, or a VM - where it runs does not
change what it looks like, which matters here because "serverless" and "undetected" get
searched together and are different problems.
What it does not do, on its own and in any environment:
- **IP reputation.** A genuine-looking browser on a known datacenter address is still on a
known datacenter address. You supply a clean exit.
- **Per-account quotas and rate limits.** These are counted server-side against your
account or key, not read off the browser.
- **Behaviour and timing.** Pacing, pointer motion and the rhythm of a session are yours
to shape. An automated cadence is visible no matter how real the fingerprint is.
Serverless makes the last one worse in a specific way: fan-out. A hundred functions firing
at once, from a small pool of platform egress addresses, in a burst no human pace explains,
is a velocity signal you created by the deployment shape rather than by the browser. A warm
worker pulling jobs at a human interval is easier to keep honest. None of that is a claim of
evasion; it is the list of things you still have to get right yourself.
## Conclusion
Can you run invisible_playwright serverless? Technically sometimes, on a generous
container-backed function tier with the engine baked into the image and kept warm.
Practically, a plain stateless function that downloads and launches a full Firefox per
invocation will be slow and fragile even where it fits, because the browser weight is
structural and no setting removes it.
The tool's job is to make the browser look real, and it does that anywhere it runs. The
deployment's job is to give that browser a warm home, a clean exit and a human pace. Put
the browser in a container image or a long-lived worker, pay the unpack once, and reuse it.
## Short answers to the questions that lead here
**Can I deploy invisible_playwright to a serverless function?** Usually not on a plain
stateless function. The patched Firefox is about 238 MB to download and roughly 544 MB
unpacked, which fights typical size, memory and time limits. A container image or a warm
worker is the real home.
**Why is the browser so heavy?** Because it is a real, full Firefox patched at the C++
level, not a JavaScript patch over an existing browser. That weight is why the fingerprint
and TLS read as genuine, and it is also why it does not fit a tiny function.
**Can I just make the function timeout longer?** No. Size and memory limits fail
independently of time, and a per-request download and launch is overhead you pay on every
cold start regardless of the timeout.
**Does running it in a container make it undetectable?** No tool is undetectable. A
container is the right place to unpack the browser once and keep it warm, but it does not
fix your IP reputation, your account quotas, or your timing. You supply those.
**How do I avoid downloading Firefox on every invocation?** Bake it into the image at
build time, or point `INVPW_BINARY_PATH` at a binary already on disk. On a stateless
function neither fully helps, because the local disk does not persist between calls.
**What is the smallest thing that works?** A single long-lived worker: launch once inside
a `with InvisiblePlaywright(...) as browser:` block, then consume a job queue inside that
block so the browser is reused for the life of the process.
## Sources
- This project's [installation](installation.md) and [configuration](configuration.md)
pages, for the measured engine download and unpacked sizes and the cache and binary-path
environment variables.
- The container walkthroughs in this set, linked above, for the build-time unpack pattern.
- Playwright's own [`Browser` class reference](https://playwright.dev/python/docs/api/class-browser),
for the stock API this wrapper hands back unchanged.
- General serverless platform limits on package size, memory and execution time, which are
documented per platform and are what the browser weight runs into.
**See also:** [how to use invisible_playwright in Docker](how-to-use-invisible-playwright-in-docker.md)
for the container build, [running Playwright in Docker undetected](how-to-run-playwright-docker-undetected.md)
for the fingerprint tells a headless container adds, and
[what a datacenter container gives away](playwright-docker-detection.md) for the machine
signals no stealth layer touches.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The weight that keeps it out
of a small function is the same weight that makes it look real.*
@@ -0,0 +1,211 @@
---
title: "Can You Run Playwright Without Being Detected?"
description: "An honest answer for Playwright automation: what removing browser-level tells clears, why it looks like a real browser, and the three signals it does not fix."
parent: "Testing and Troubleshooting"
grand_parent: "Guides"
nav_order: 11
---
# Can You Run Playwright Without Being Detected?
Not in an absolute sense, and any tool that promises otherwise is lying to you.
What is achievable is narrower and more useful: you can remove the browser-level
tells so the fingerprint and the automation flags read like a real person's browser,
and that alone clears most JavaScript-based detection. The rest of what gets a session
flagged is not a browser problem at all, and no amount of browser work touches it.
This page draws that line precisely. It shows what "undetected" can honestly mean,
what a real-browser fingerprint clears, and the three signal classes that are detected
independently of the browser and that you, not the tool, have to supply an answer for.
## The honest answer: "looks like a real browser", not "invisible"
The useful reframing is to stop asking "can I be undetected" and start asking "does
this look like a real browser driven by a real person". That is a question you can
actually answer yes to, and it is the one that most detection is really asking.
A detector almost never has a single "is this a bot" bit. It has a pile of signals and
a score. Some of those signals live in the page, in JavaScript: the fingerprint, the
automation flags, whether any built-in has been tampered with. Some live below the
page: the network handshake, the exit address. Some live in what the session does over
time: pacing, motion, request velocity.
A tool that drives a genuine, unmodified-looking browser can make the first pile read
clean. It cannot make the other two piles read clean, because they are not properties
of the browser. Being honest about that split is the whole point of this page, and it
is why [passing every public suite still does not mean the session passes](how-to-test-bot-detection.md).
## What "detected" actually means: three layers of signal
Before touching code, it helps to name the three layers, because a fix for one does
nothing for the others.
1. **The browser layer.** The fingerprint (GPU, canvas, audio, fonts, screen), the
automation flags ([`navigator.webdriver`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver)
and friends), and internal consistency
(does the platform you claim agree with the fonts you have). This is in JavaScript's
reach, and it is the layer a stealth engine addresses.
2. **The network layer.** The TLS handshake, the HTTP/2 settings frame, header order,
and the reputation of the exit address. Decided before a line of page script runs,
and [invisible to every in-page test](ja3-ja4-tls-fingerprint.md).
3. **The behaviour layer.** Pointer motion, typing rhythm, how fast a form is filled,
how many requests per minute from one account, and the timing shape of an
automated agent.
invisible_playwright is built to solve layer 1 well, and it drives a real Firefox
binary, which means layer 1's network handshake is a genuine Firefox handshake rather
than an impersonation. What it deliberately does not do is manufacture a clean IP, a
per-account quota, or human pacing. Those are yours to bring.
## What invisible_playwright removes: the browser layer
The product is a Firefox patched at the C++ level, driven by stock Playwright, with a
fingerprint derived from a seed so it is real-browser-shaped and reproducible. Every
session gets a coherent identity (roughly 400 fields that agree with each other)
instead of the default automation profile that detectors are trained on.
Switching from plain Playwright is a two-line change, and the object you get back is a
real Playwright `Browser`, so every method works exactly as documented upstream:
```python
from invisible_playwright import InvisiblePlaywright
# seed=42 makes the identity reproducible; drop it for a fresh one each run
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# navigator.webdriver reads undefined, the fingerprint is internally
# consistent, and the TLS handshake is a real Firefox handshake
print(page.evaluate("navigator.webdriver")) # -> None
```
Add a proxy and let the browser timezone follow the exit automatically, which is how
you keep the browser and the network from telling two different stories:
```python
proxy = {"server": "socks5://gate.example.com:1080", "username": "u", "password": "p"}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com/login")
page.fill("#user", "someone")
page.click("#submit") # the pointer arcs to the button on a curve
```
The measurable result of layer 1 being clean: open the same fingerprinting page in
this browser and in a stock Firefox on the same machine, diff the reports field by
field, and the difference collapses to per-session noise (the IP and the random canvas
jitter a real browser also has). The JavaScript detectors read it as a genuine Firefox
because, at the layer they can see, it is one. That is why it passes most of them. It
is also the ceiling of what the browser layer can do.
## The three signal classes it deliberately does not touch
This is the part most "undetectable" claims skip. These three are detected
independently of the browser, the tool does not address them by design, and a clean
fingerprint on top of any one of them still loses.
- **IP reputation.** A perfect browser on a datacenter range, or on a residential exit
a thousand other people are sharing this minute, is still on a flagged address, and
that is decided before your script runs. Around 90 percent of cheap proxies are
public and already known. The fix is a clean exit, which is your input, not the
browser's output. [WebRTC through a proxy](webrtc-leak-proxy.md) is the related
browser-visible surface, but the reputation itself is not a browser property.
- **Per-account rate limits and quotas.** If one account does in an hour what a person
does in a week, no fingerprint hides it, because the signal is the account's own
history, not the browser's identity. Spreading work across accounts and staying under
human volume is an application-design decision the tool cannot make for you.
- **Behaviour and timing.** Uniform keystroke intervals, a form filled in eighty
milliseconds, a pointer that teleports, a request cadence with no human jitter, or
[the pause shaped exactly like model latency in an agent loop](ai-browser-agents-stealth.md).
The engine gives you curved mouse motion for clicks, but the overall rhythm of the
session is driven by your code.
None of these is a gap or a bug. They are outside the browser, so they are outside what
a browser-fingerprint tool can honestly claim. Pairing a real-browser fingerprint with
a clean exit and human pacing is the actual recipe; the tool is one of those three
parts.
## How to check what is left over
Because the browser layer is handled, your testing effort should go to the two layers
that are not. The method that catches the most:
- **Prove it is the browser before blaming it.** Open the target by hand from the same
machine and network. If the manual visit also gets the wrong page, this is the IP or
the account, and no browser change helps. This ordering is the whole point of the
[detected-on-one-site checklist](playwright-detected-as-bot.md).
- **Compare against a stock browser, do not read a score.** Diff the fingerprint fields
against a real Firefox on the same machine. Anything that matches is not your problem
whatever the verdict says; anything that differs, other than the address, is a
candidate.
- **Assert presence, not absence.** A blocked or empty signal is itself a tell and a
failure, not a pass. [Why a green verdict can mean the feature is broken](how-to-test-bot-detection.md)
is the trap here.
- **Watch the score, not just the pass line.** A [trust or confidence score](browser-trust-score-explained.md)
tells you more than a binary verdict, and it is where residual behaviour and IP
signals show up even when the fingerprint is clean.
Run any of this at least ten times, through the proxy you actually deploy with, on the
machine you actually deploy on.
## Conclusion
Can you run Playwright without being detected? You can make it look like a real browser
driven by a real person, and that clears most JavaScript-based detection, which is what
invisible_playwright is built to do: a patched Firefox, a seed-consistent real-browser
fingerprint, and a genuine handshake because the browser is genuine. What it does not
do, on purpose, is fix your IP reputation, your per-account quotas, or your behaviour
and timing. Those are detected independently, and you supply the answers: a clean exit
and human pacing. Treat "undetectable" as a slogan and you will overclaim; treat it as
"looks like a real browser, plus the two layers I own", and you will actually pass.
## Short answers to the questions that lead here
**Can Playwright be truly undetectable?** No, and any tool that says so is lying. You
can remove the browser-level tells so the fingerprint and flags look like a real
person's browser, which clears most JavaScript detection. IP, account limits and
behaviour are detected separately.
**Why does invisible_playwright pass most checks then?** Because at the layer those
checks can see, it is a real Firefox: real fingerprint, no automation flags, a genuine
handshake. Most public detection is a JavaScript check, and that is exactly the layer
it addresses.
**If my fingerprint is clean, why am I still blocked?** Almost always the IP, the
account's own request history, or the behaviour. Those are not browser properties, so a
clean browser does not touch them.
**Does it fix my proxy or my IP reputation?** No. It deliberately does not touch the
exit address. A perfect browser on a known-bad IP still loses, and you supply the clean
exit.
**Does it make my automation behave like a human?** It gives you curved mouse motion
for clicks, but the pacing, typing rhythm and request volume come from your code. That
is the behaviour layer, and it is yours.
**Is a passing sannysoft or CreepJS result enough to be safe?** No. It means the
browser layer is internally consistent and does not announce automation. The network
and behaviour layers are not in those tests at all.
## Sources
- This project's release gates, which compare the browser's fingerprint field by field
against a stock Firefox on the same machine and treat a suppressed signal as a
failure rather than a pass.
- The public detection suites named across this documentation set (sannysoft, CreepJS,
BotD, FingerprintJS, BrowserLeaks), each read from its own source rather than its
rendered verdict.
**See also:** [how to test whether your browser is detected](how-to-test-bot-detection.md),
[the checklist for being detected on one site](playwright-detected-as-bot.md), and
[what a browser trust score actually measures](browser-trust-score-explained.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. It is built to look like
a real browser, which is why it passes most checks and why it will never claim to make
you invisible.*
@@ -0,0 +1,245 @@
---
title: "Canvas fingerprint changes every run: use a seed"
description: "Canvas, WebGL and audio hashes change every Playwright run because each session draws a fresh identity. Pass a fixed seed to make readbacks byte-identical."
parent: "Testing and Troubleshooting"
grand_parent: "Guides"
nav_order: 6
---
# Canvas fingerprint changes every run: use a seed
A canvas fingerprint that changes on every Playwright run is not a leak or a bug. Without
a seed, each session is handed a fresh, self-consistent device, so the canvas, WebGL and
audio readbacks are recomputed at every launch. Pass a fixed seed and all three come back
byte-identical, run to run. That single argument is the whole fix.
You open a fingerprinting page twice from the same automation, and the canvas hash
is different each time. The WebGL hash moves too, and so does the audio one. Nothing
in your code changed between the two runs, and yet the machine looks like a different
machine.
This is one of the most common confusions people hit with a fingerprint-spoofing
browser, and it is almost always a misread rather than a bug. A hash that changes on
every run is not noise leaking into your readback. It is a fresh identity being drawn
for each session, exactly as designed, and the fix is one argument.
## What "changes every run" actually means
Canvas, WebGL and audio are the three surfaces that read back a rendered value: you
draw something, then read the pixels or the samples out and hash them. On a real
machine that hash is stable, because the same GPU, the same font stack and the same
audio pipeline draw the same thing every time.
In this browser, those three readbacks are overwritten before they reach your code.
The value you read is a pure function of one number: an internal hardware seed the
wrapper derives from the identity seed of the session. Same seed in, same bytes out.
Different seed, different bytes.
So when you launch without passing a seed, each session gets a new one, and the three
hashes move together in a self-consistent way. That is not the spoof failing. That is
the spoof drawing a new device for you. The trouble is that a device which looks
brand new on every visit is its own signal, and it is usually not the signal you want.
## Why a per-run identity reads as a rotating device
A stable fingerprint is not automatically a suspicious one. What draws attention is a
fingerprint that behaves in a way real hardware cannot.
Real hardware does not change its canvas hash between two visits. If a site, or a
linkability service like [FingerprintJS, which hands you a visitor ID](fingerprintjs-visitor-id.md),
sees the same cookie or the same login return with a different canvas hash, a
different WebGL renderer and a different audio signature every time, that is a machine
that is repainting itself. Very few legitimate users look like that, and a scorer that
watches for churn will notice.
So the per-session default is the right behaviour for one job and the wrong one for
another:
- **You want a fresh identity per session.** Many short, unrelated visits, nothing
that should be linked, no returning account. Launch with no seed and take a new
device each time. This is the default for a reason.
- **You want the same identity every session.** A returning account, a persisted
profile, or simply a bug you are trying to reproduce. Here a rotating device is a
liability, and you pin it with a seed.
The mistake is not the rotation. The mistake is leaving it on when the situation calls
for a stable machine.
## Pin the seed and the readbacks stop moving
Pass a seed explicitly and every field it implies comes back identical: the GPU
string, the canvas hash, the WebGL hash, the audio context, the fonts, the screen.
The browser object you get back is a real Playwright
[`Browser`](https://playwright.dev/python/docs/api/class-browser), so the rest of your
code does not change.
```python
from invisible_playwright import InvisiblePlaywright
# Same seed -> same canvas / WebGL / audio hash, every run.
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# read your fingerprint page here; the readbacks are now stable
```
Run that twice and the three readbacks are byte-identical between the two runs,
because they are computed from the same seed both times. Change the number and you get
a different, equally self-consistent machine:
```python
# A different but still internally coherent device.
with InvisiblePlaywright(seed=1001) as browser:
...
```
The async surface is the same, one keyword apart:
```python
from invisible_playwright.async_api import InvisiblePlaywright
async with InvisiblePlaywright(seed=42) as browser:
page = await browser.new_page()
await page.goto("https://example.com")
```
If you launched without a seed and now want to keep the identity you happened to get,
you do not have to guess it. Every session records the seed it was generated from, so
log it once and you can replay that exact machine later:
```python
sf = InvisiblePlaywright() # no seed -> a fresh one is drawn
with sf as browser:
print("seed =", sf.seed) # write this down to reproduce this device
page = browser.new_page()
page.goto("https://example.com")
```
## Prove it: read the same hash twice
Do not take the determinism on faith. The whole point of the earlier troubleshooting
pages is that you [assert the presence of the right value rather than the absence of a
wrong one](how-to-test-bot-detection.md), and this is a case where you can measure the
right value directly.
Draw to a canvas, read it back with
[`toDataURL()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL),
and compare the hash across two launches with the same seed:
```python
import hashlib
from invisible_playwright import InvisiblePlaywright
DRAW = """() => {
const c = document.createElement('canvas');
c.width = 300; c.height = 150;
const ctx = c.getContext('2d');
ctx.textBaseline = 'top';
ctx.font = '16px sans-serif';
ctx.fillStyle = '#069';
ctx.fillText('fingerprint probe 12345', 10, 10);
return c.toDataURL();
}"""
def canvas_hash(seed):
with InvisiblePlaywright(seed=seed) as browser:
page = browser.new_page()
page.goto("https://example.com")
data_url = page.evaluate(DRAW)
return hashlib.sha256(data_url.encode()).hexdigest()
a = canvas_hash(42)
b = canvas_hash(42)
c = canvas_hash(1001)
print("same seed match:", a == b) # True: byte-identical across runs
print("different seed differs:", a != c) # True: a different device
```
The first comparison is the one that matters. `a == b` being `True` is the readback
proving it is a stable function of the seed, not per-call randomness. This is exactly
what the project's own consistency gate checks on every release: it launches the same
seed more than once and requires an identical visitor ID from a linkability library,
and it fails the build if the two runs disagree. A green gate there means the same seed
is the same machine, run to run.
Because the readback is a function of the seed and not of the host, the same seed also
holds its hash across operating systems, which is
[why a Linux container and a Windows laptop can return the same canvas](canvas-webgl-cross-platform-consistency.md).
If instead the two hashes for one seed disagree within a single machine, that is the
tampering signal to chase, and reading the same value twice in one session is
[the cheapest such check there is](canvas-fingerprint-noise.md).
## Match the seed to the profile
Pinning the seed and pinning the profile are two halves of one decision. If you keep a
[persistent profile so cookies and storage survive between runs](persistent-profiles.md),
give it a stable seed as well. A profile that returns with the same cookies but a
different canvas hash is telling two stories at once: the account remembers you, the
hardware does not, and that contradiction is easier to spot than either half alone.
The clean pairings are the obvious ones. A fresh throwaway profile takes a fresh seed.
A durable identity that comes back tomorrow takes the same profile and the same seed
it had yesterday. Keep the two in step and the machine you present stays coherent over
its whole life instead of only within a single launch.
## Conclusion
A canvas hash that changes on every run is not a leak, it is a new device being drawn
per session, and it is the correct default for unrelated one-off visits. When you need
a machine that stays the same, whether for a returning account, a persisted profile or
a reproducible bug, pass a seed. The three readbacks then become a byte-identical
function of that seed, run to run and across operating systems, and the account and the
hardware finally tell the same story.
## Short answers to the questions that lead here
**Why does my canvas fingerprint change every run?** Because each session without a
seed gets a fresh, self-consistent identity by design. The readback is a function of
the session's seed, and a new session means a new seed.
**How do I make the canvas hash stable?** Pass a fixed seed at launch, for example
`InvisiblePlaywright(seed=42)`. The canvas, WebGL and audio readbacks then come back
identical on every run.
**Is a changing fingerprint a bug?** No. It is deliberate rotation. It becomes a
problem only when you needed a stable machine, for instance behind a returning account
or a persisted profile, and left rotation on.
**Does the same seed give the same hash on a different machine?** Yes. The readback is
computed from the seed, not from the host GPU or fonts, so the same seed holds its
hashes across operating systems.
**How do I reproduce the exact identity from an earlier run?** Read the session's seed
after launch and log it. Passing that number back reproduces the same device.
**Should the seed match my persistent profile?** Yes. A profile that returns with the
same cookies but a different fingerprint is a contradiction. Keep one stable seed per
durable identity.
## Sources
- The project's fingerprint generator, in which the canvas, WebGL and audio readbacks
are computed as a pure function of a hardware seed derived from the session seed.
- The release consistency gate, which relaunches a fixed seed and requires an
identical visitor ID from run to run, and fails the build otherwise.
- The [quickstart](quickstart.md) and [configuration](configuration.md) pages in this
documentation set for the seed argument and the API it belongs to.
- Playwright's own [`Browser` API reference](https://playwright.dev/python/docs/api/class-browser)
for what `new_page` returns: the object every example above drives is the standard
Playwright API, not a fork of it.
- MDN's [`HTMLCanvasElement.toDataURL()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)
reference for the readback method the proof above uses to pull bytes off the canvas.
**See also:** [how to test whether your browser is detected](how-to-test-bot-detection.md)
for the assert-the-right-value method, and
[the checklist for being detected on one site](playwright-detected-as-bot.md), whose
last step is to pin the identity so a failure is reproducible.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The seed is the same
lever whether you are hiding rotation or reproducing a bug: pin it and the machine
stops moving.*
+187
View File
@@ -0,0 +1,187 @@
---
title: "Canvas fingerprint noise: why per-call randomising fails"
description: "Per-call canvas fingerprint noise fails a detector that reads twice and flags as masking on a second check. What a consistent canvas actually looks like."
parent: "Canvas, WebGL, Fonts and Audio"
grand_parent: "Guides"
nav_order: 1
---
# Canvas fingerprint noise: why per-call randomising fails
Per-call canvas fingerprint noise fails because a detector can read the same canvas
twice. Real hardware returns an identical result both times; per-call noise returns two
different ones, which flags the browser as tampering rather than merely unusual. The fix
is not more noise, it is noise that stays consistent within a session and across sessions
of the same identity.
The standard advice for canvas fingerprinting is to add a little noise to the pixels so
your hash is not stable. It is the most widely deployed anti-fingerprinting technique
there is, and against a detector that asks once it works.
Against a detector that asks twice it is the thing that gets you caught. This page is
the check that catches it, the second check almost nobody knows about, and what a
consistent alternative has to look like.
## The check that catches per-call noise
Render the same canvas twice in the same page with
[`toDataURL()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)
and compare.
```js
function hash() {
const c = document.createElement('canvas');
const ctx = c.getContext('2d');
ctx.textBaseline = 'top';
ctx.font = '14px Arial';
ctx.fillText('abcdefghijklmnop', 2, 2);
return c.toDataURL();
}
hash() === hash(); // real hardware: true. Per-call noise: false.
```
On real hardware the answer is always identical, because drawing the same shapes with
the same rasteriser produces the same pixels. There is no source of variation.
A tool that adds `Math.random()` to the pixel values on every read produces two
different answers, and now the page knows something far more specific than your canvas
hash: it knows your canvas is being tampered with. An unusual hash makes you rare. A
hash that changes between two reads one millisecond apart makes you impossible.
This is four lines of JavaScript. Assume it is running.
## The second check, which is subtler
A detector draws a **small canvas filled with a handful of solid reference colours**,
then reads it back with
[`getImageData()`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData)
and checks those exact colour values came back unchanged. Not a hash, not a comparison
between two reads: an assertion that a flat red rectangle is still exactly that red.
The first check above is well known enough that better tools already seed their noise,
so two reads agree. This second shape is subtler, and it is worth understanding because
it caught us.
Real rendering does not change a solid fill. Any per-pixel noise does, even seeded
noise, even tiny noise. And a tool that fails this is not scored as "unusual", it is
scored as **masking detected**, which is a different and worse category.
The fix is a guard: before altering anything, count the distinct colours in the buffer.
If there are only a few, the render is a reference probe rather than a fingerprint, and
you leave it alone. Small buffers get the same treatment, for the same reason.
We shipped without that guard and learned it from a detector telling us so. The general
form is the same one that appears in audio and everywhere else:
> A detector does not have to recognise your noise. It only has to ask a question whose
> correct answer is already known, and check whether it still gets that answer.
## Additive noise versus substitution, and the cost nobody states
There are two ways to make a canvas read return something other than the truth.
| Approach | What it does | Same hash across machines? | Main cost |
|---|---|---|---|
| Additive noise | Perturbs each pixel slightly; the image still looks the same, the hash changes | No. The operating system's text stack still shows through the perturbation | The underlying platform signature leaks |
| Substitution | Replaces pixel values wholesale with seed-derived values | Yes. The hash is a pure function of the seed | Real canvas work (cropping, QR decoding, a video frame) gets the substituted values too |
**Additive.** Perturb each pixel slightly. The image still looks like the image, the
hash changes. This is what extensions do.
**Substitution.** Replace the pixel values wholesale with values derived from a seed.
The hash is then a pure function of the seed and nothing else, which means it is
identical on every machine running that identity, including a Linux server pretending
to be Windows.
Substitution is stronger for consistency, because with additive noise the underlying
rendering still carries the signature of
[the operating system's text stack](bundled-fonts-cross-platform.md) under the
perturbation. Two machines with different font backends produce different base images,
and a small perturbation on top does not hide that -
[this is the reasoning that gets the same seed to the same byte-identical hash on
Windows and Linux](canvas-webgl-cross-platform-consistency.md), not just a similar one.
Now the cost, which is real and which most write-ups omit. A substitution applied at
readback does not know why the page is reading the canvas. It cannot distinguish a
fingerprinting probe from an application that is cropping a photo, decoding a QR code,
capturing a video frame or applying a filter. Those all read pixels through the same
API, and they all get the substituted values.
So if your automation does real canvas work, you have to know this is happening. It is
a trade, not a free win, and anyone presenting per-pixel protection as costless has not
built one.
## What a defensible canvas looks like
Working backwards from the checks above:
- **Stable within a session.** Two reads agree. Non-negotiable and trivially checked.
- **Stable across sessions of the same identity.** A hash that changes every launch
describes a machine that changed its GPU overnight.
- **Different between identities.** Otherwise every user of the tool shares one hash,
which is its own cohort.
- **Solid fills come back solid.** Reference probes are untouched.
- **Consistent with the rest of the claim.** A canvas that says one platform under a
user agent that says another is caught by comparison, not by rarity.
That list is short and every item is a thing a page can verify in a few lines. That is
the level the checks are actually at.
The same canvas element carries a second surface that doesn't involve reading a single
pixel: [`measureText()` and its ten-plus numeric fields](measuretext-textmetrics-fingerprinting.md),
which fail the same way for the same reason if the noise added to them accumulates
instead of staying bounded.
## Checking your own
```js
const a = hash(), b = hash();
console.log('stable within session:', a === b);
// solid-fill probe
const c = document.createElement('canvas'); c.width = 70; c.height = 5;
const ctx = c.getContext('2d');
ctx.fillStyle = '#ff0000'; ctx.fillRect(0, 0, 10, 5);
const px = ctx.getImageData(0, 0, 1, 1).data;
console.log('solid red survived:', px[0] === 255 && px[1] === 0 && px[2] === 0);
```
Then relaunch with the same identity and confirm the first hash is the same value. Two
launches, one identity, one hash.
## Short answers to the questions that lead here
**Does adding noise to canvas prevent fingerprinting?** It prevents a stable identifier
and it announces that something is modifying the canvas. Which of those matters depends
on whether anything is checking.
**Is Canvas Blocker style protection detectable?** The per-call randomisation kind is,
in four lines. That is a statement about the technique, not about any particular tool.
**Why does my canvas hash change on every page load?** Because something is randomising
per call or per session. No real machine does that; there is
[a dedicated page on why a canvas fingerprint changes every run](canvas-fingerprint-changes-every-run.md).
**Should the hash be unique to me?** It should be consistent for one identity and
different between identities. Unique-per-request is not privacy, it is a signature.
**Does `privacy.resistFingerprinting` solve this?** It alters canvas readings, and it
also makes you identifiable as someone running that mode. There is
[a longer page on that trade](resist-fingerprinting.md).
**Will noise break my application?** If you read pixels for anything real, yes,
potentially. Protection applied at readback cannot tell your QR decoder from a
fingerprinting probe.
**See also:** [AudioContext fingerprinting](audiocontext-fingerprinting.md), where the
same per-call mistake has the same consequence and where our own noise turned out to be
the thing being detected, [what sannysoft checks](sannysoft-explained.md), whose
canvas-in-iframe rows are a consistency test rather than a fingerprint test, and
[how BrowserLeaks reports the canvas and WebGL hash](browserleaks-canvas-webgl-hash.md).
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. The solid-fill guard exists because we shipped
without it.*
@@ -0,0 +1,149 @@
---
title: "Canvas and WebGL fingerprints, identical across OSes"
description: "Canvas and WebGL fingerprints identical across Windows and Linux: intercept readback, not the render, so one seed produces a byte-identical hash on every OS."
parent: "Canvas, WebGL, Fonts and Audio"
grand_parent: "Guides"
nav_order: 9
---
# Canvas and WebGL fingerprints, identical across OSes
A GPU-backed render surface can't be read from or written to directly and safely, so
the fix intercepts the one place JavaScript can actually see the result instead - the
same seed then produces a byte-identical canvas and WebGL hash on Windows and Linux.
[Why headless browsers render different fonts](headless-fonts-differ.md) and
[how to make Linux and macOS report real Windows fonts](bundled-fonts-cross-platform.md)
cover the same shape of problem and fix, for text instead of pixels.
## The surface you can't safely touch is not the surface JavaScript reads
A GPU-backed render target is not something you can map and rewrite freely - reading
one directly with the ordinary in-process API can crash rather than return data,
depending on the backend. That rules out the obvious approach of patching the render
itself.
It turns out you don't need to. Content never touches the render surface directly. It
only ever gets pixels back through a small, enumerable set of export calls:
[`toDataURL`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL)
and [`toBlob`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob),
[`getImageData`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData),
[`readPixels`](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels),
a captured [`OffscreenCanvas`](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas),
and the chain that runs through
[`createImageBitmap`](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
Every one of those is a **readback** call, and readback is a single choke point you
can intercept safely, even when the surface behind it cannot be touched directly.
So the fix is the same shape as the font one: block the host's real value at the one
place content can actually observe it, rather than trying to prevent the value from
existing in the first place.
## What gets overwritten, and what doesn't
At each readback call, the real pixel buffer is rewritten with output derived from
the session's seed and the pixel's own position, before JavaScript ever sees it - for
both the canvas-2D path and the WebGL path, since they are separate APIs with
separate export calls that both needed the same treatment.
The one thing this has to get right is not breaking the pages that read canvas
content for a legitimate reason. A reference probe - a handful of flat colours used
to check whether canvas output has been tampered with at all - looks nothing like a
real rendered scene: very few distinct colours across the whole buffer. Below a
small distinct-colour threshold, the output is left untouched; above it, the
substitution applies in full. A solid red rectangle comes back solid red. A real
rendered scene, which is high-entropy by construction, gets the full treatment. This
is what keeps a masking-detection probe from immediately noticing that something
intercepts every readback.
## Why substitution instead of noise, here specifically
[Adding noise per call is the common approach, and it fails a very cheap check](canvas-fingerprint-noise.md):
read the canvas twice in the same page and compare. What makes substitution the
right choice for cross-platform consistency specifically is a different property:
substituted output is a pure function of the seed and the pixel position, with zero
input from the actual rendering pipeline underneath. Additive noise on top of a real
render still carries the render's own signature - two machines with different font or
GPU backends produce different base images, and a small perturbation on top doesn't
hide that. Substitution removes the underlying image from the equation entirely, so
there's nothing left for the host to leak into the result.
There's a second, sharper way per-pixel noise fails, found on this exact surface: a
detector doesn't need two reads to catch it, because the noise itself has a
statistical shape that a single read can flag. A small random offset applied to a
fraction of pixels reads as unnaturally high-frequency variation - a masking-detection
check built to look for exactly that pattern flagged it directly, on the WebGL
readback specifically, with the rest of the fingerprint surface clean. Replacing it
with a per-channel remap - which looks like an ordinary colour-profile difference
between GPUs rather than injected noise - took a measured spike count from roughly
320 down to near zero on the same probe. Substitution inherits that property too,
for the same reason: nothing about it resembles noise added on top of a real signal.
| Approach | How it hides the host | Where it fails |
|---|---|---|
| Additive per-call noise | Perturbs a fraction of pixels on top of the real render | Two reads in one page differ; the real render's font/GPU signature still shows through; the noise has a high-frequency shape a single read can flag |
| Full substitution | Replaces pixels with a pure function of the seed and the pixel position, with zero input from the render underneath | Must leave low-entropy buffers untouched so it does not break legitimate canvas reads |
## The proof: byte-identical hashes, not just "looks similar"
Rendered the same seed's canvas (text plus a gradient) and WebGL scene (a
high-entropy draw) on Windows and on Linux, hashed both in-page. The hashes matched
byte for byte on both platforms. Run against a commercial fingerprint scanner across
multiple seeds, zero failures on either OS.
That is a stronger claim than "produces a plausible fingerprint." It's the same
identity, provably, regardless of which OS is actually running underneath - which is
what makes a seed a real, portable identity instead of a value that happens to look
right on the machine it was tested on.
## What this generalises to, and where the edges still are
The underlying idea applies to any surface where content can only see a value
through a small number of export or readback calls: intercept there, and it doesn't
matter what happens upstream. It is also, necessarily, an enumeration problem - the
fix is only as complete as the list of export paths it covers, and browsers keep
adding new ones (newer capture and streaming APIs, newer GPU-facing interfaces).
Treat any such list as something that needs revisiting as the platform grows, not as
a fact that becomes true once and stays true.
## Short answers to the questions that lead here
**Can canvas and WebGL fingerprints be made identical across operating systems?**
Yes, if the interception happens at every point content can read the result rather
than at the render itself, which is the part that can't be touched directly on a
GPU-backed surface.
**Why substitution instead of adding noise to the real render?** Noise on top of a
real image still carries the host's own rendering signature underneath it.
Substitution replaces the value entirely, so nothing about the actual host reaches
the output.
**Won't this break real uses of canvas, like image editing or QR decoding?** A
masking-safe design leaves near-uniform, low-entropy output untouched and only
substitutes high-entropy renders, which is what a fingerprinting probe looks like
and an image editor's output usually doesn't - though the same caveat as
[canvas fingerprint noise](canvas-fingerprint-noise.md) applies if your own use case
happens to fall on the wrong side of that line.
**Is this the same fix as the font work?** The same shape - intercept at the point
content can observe, not at the source - applied to a different surface.
**See also:** [canvas fingerprint noise](canvas-fingerprint-noise.md), for why
per-call randomisation specifically fails; [how to make Linux and macOS report real
Windows fonts](bundled-fonts-cross-platform.md), for the same architecture applied to
fonts; [WebGL renderer strings](webgl-renderer-strings.md), for the adjacent
surface of what the GPU claims to be rather than what it draws; and
[how the BrowserLeaks canvas and WebGL hash is computed](browserleaks-canvas-webgl-hash.md),
for what that hash actually measures.
## Sources
- This project's own render-readback interception work and its cross-platform
validation (same-seed byte-identical hashes on Windows and Linux, multi-seed
results against a commercial fingerprint scanner).
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level, on making a seed mean the same machine regardless
of what it's actually running on.*
+159
View File
@@ -0,0 +1,159 @@
---
title: "The ChromeDriver `cdc_` variable, and why renaming it fails"
description: "The cdc_ variable ChromeDriver leaves on the page is a one-line Selenium test. Renaming it in the binary raises the bar but does not remove the tell."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 2
---
# The ChromeDriver `cdc_` variable, and why renaming it fails
**The `cdc_` variable is a property that ChromeDriver injects into every page it
controls, and its presence is a one-line test for Selenium automation. Renaming the
string in the binary hides it from a check that greps for the exact prefix, but not
from one that looks for the pattern, because the properties are still on the page.**
If you have automated Chrome with Selenium and been detected, you have probably met
this variable. This is what it is, why renaming it in the binary does not remove it,
and what that generalises to.
The check looks like this:
```js
Object.getOwnPropertyNames(document).find(k => k.startsWith('cdc_'))
```
or the same thing scanning `window`. It is a two-line test, it is in every
bot-detection script, and understanding why it works explains a lot about how this
whole category of tell comes to exist.
## What the variable is
ChromeDriver, the binary Selenium talks to, needs to run its own JavaScript inside
the page: that is how it finds elements, reads text, and executes your `execute_script`
calls. To do that it keeps some state on the page's own objects, under names derived
from a fixed string compiled into the binary. Historically they look like this:
```
cdc_adoQpoasnfa76pfcZLmcfl_Array
cdc_adoQpoasnfa76pfcZLmcfl_Promise
cdc_adoQpoasnfa76pfcZLmcfl_Symbol
```
The prefix is stable across installations because it is a literal in the executable,
which is exactly what makes it a reliable signal. A page that finds one of those
property names is not guessing: nothing else puts them there.
Note what this is not. It is not a flag someone forgot to remove, and it is not the
same class of thing as `navigator.webdriver`. It is working state that the tool needs
in order to function.
## Why the usual fix is a rename
The well-known remedy, and what [`undetected-chromedriver`](vs-undetected-chromedriver.md)
does, is to patch the binary and replace that literal with a different random-looking
string of the same length. Same length matters: it is an in-place patch of a compiled file, so the
replacement has to fit.
That works against the check at the top of this page, because the check greps for
`cdc_`. It does not work against a slightly better one.
The variables are still there, still on `document`, still a set of three related
names appearing together, still matching a shape no page author would produce. A
detector that looks for *the pattern* instead of the prefix, three own properties on
`document` with a common random-looking stem and typed suffixes, finds them again.
And because the patch has to preserve length, the shape of the replacement is
constrained in ways that make it recognisable.
So: renaming raises the bar, it does not remove the surface. That distinction is the
whole point of this page, and it applies far beyond this one variable.
## The general shape of the problem
Any automation tool that needs to run code in the page needs somewhere to keep state.
The options are:
1. **Put it on page objects under a known name.** Easy, and detectable by name.
2. **Put it on page objects under a randomised name.** Harder, and detectable by
shape.
3. **Do not put it on page objects at all.** Keep the state on the driver side of the
boundary, or in an execution context the page cannot enumerate.
Option three is the only one that removes the surface instead of obscuring it, and
it is a design decision made long before anyone runs a detection test. It is also why
["which stealth plugin should I use"](playwright-stealth-levels.md) is often the wrong
question: no plugin can move state out of the page after the fact.
## Where Firefox differs, and where it does not
Firefox's automation does not use ChromeDriver, so `cdc_` does not exist there. That
is a fact about the protocol, not a virtue: Firefox's automation surfaces are
simply different ones.
What Firefox does still do by default is set `navigator.webdriver` to `true` when a
session is under automation control, because the
[WebDriver specification](https://www.w3.org/TR/webdriver2/) requires it: the
property reflects a "webdriver-active" flag the spec sets whenever the user agent
is under remote control. So a stock Playwright Firefox is trivially detectable too,
just by a different two-line check, and anyone claiming Firefox is inherently
undetected is selling something.
The useful difference is architectural, not moral. Firefox's automation
protocol runs in privileged code with its own execution contexts, so the state a
driver needs does not have to live where the page can enumerate it. Whether a given
tool takes advantage of that is a separate question from whether the engine allows
it.
## What to actually check
If you are debugging a detection problem on a Chromium-based stack, check in this
order:
1. `Object.getOwnPropertyNames(document)` and the same for `window`, looking for
groups of related unfamiliar names, not one specific prefix.
2. `navigator.webdriver`, remembering that `false` is not the same answer as
`undefined`, and a clean browser gives the latter.
3. Whether anything you loaded has patched a built-in: print
`Function.prototype.toString.call(navigator.__lookupGetter__('webdriver'))` and
see whether it says `[native code]`.
4. The non-automation signals, which is usually where the real problem is by the time
you have got this far: the GPU string, the font set, the timezone against the IP.
Number four catches more sessions than one to three combined, and it is the one
nobody checks first.
## Short answers to the questions that lead here
**What is the `cdc_` variable?** A property ChromeDriver injects into the document,
whose name starts with `cdc_` followed by a random-looking string. Its presence is a
one-line check for Selenium automation.
**Does renaming it in the binary work?** Against a check that greps for the exact
prefix, yes. Against a check looking for the *pattern*, three unexpected own properties
on `document`, no, because renaming does not remove them.
**How do I find it?** Enumerate `document`'s own properties and look for entries no
normal document has.
**Does Playwright have an equivalent?** Not this one, because it does not use
ChromeDriver, and not a comparable global either - checked directly, enumerating
every own property on `window` in a live Playwright-driven Chromium session finds
nothing resembling `window.__playwright` or any similarly-named global. Some
online guides describe one anyway; it is worth checking a claim like that yourself
before repeating it, the same way this page checks `cdc_` by opening a real
session rather than trusting a description of one. That does not mean Playwright
sessions have no artefacts at all - [each automation stack has its own, and each
one is a function whose source can be printed](tostring-native-code-detection.md) -
only that this specific one does not appear to be real.
**What is the real fix?** Do not add the properties at all, which means the automation
layer has to be built differently rather than patched afterwards.
**See also:** [why setting `navigator.webdriver` to false is worse than leaving it alone](navigator-webdriver-explained.md), [the three levels a stealth tool can work at](playwright-stealth-levels.md), since where the state lives is a level-two decision, and [selenium-stealth's actual maintenance status](selenium-stealth-unmaintained.md), for the popular package that patches properties next to this one.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. Firefox-based, so `cdc_` was never our problem,
but the general shape of it is everybody's.*
+259
View File
@@ -0,0 +1,259 @@
---
title: "Chromium is not Chrome, and detectors know the difference"
description: "Chrome for Testing, Playwright's default since 1.57, plays H.264 but still fails the Widevine DRM check - a compiled-in gap that no JavaScript patch can close."
parent: "Comparisons"
nav_order: 3
---
# Chromium is not Chrome, and detectors know the difference
**Short answer:** no, they are not the same, and the gap moved in 2026 rather than closing.
Playwright's default Chromium - Chrome for Testing since v1.57 - now plays the same
H.264/AAC codecs as real Chrome, checked directly in a live session. It still fails
Chrome's [Widevine DRM check](https://developer.mozilla.org/en-US/docs/Web/API/Encrypted_Media_Extensions_API), and that part cannot be patched from JavaScript because it is
a compiled-in capability, not a value a page reads off a string.
Every stealth guide for Chromium-based automation quietly assumes "Chromium" and "Chrome"
mean the same thing, or that the gap between them is fixed and permanent. Neither is true.
The gap is real, it moved in 2026, and one part of it is still a **compiled-in capability**
that a page can test for directly and that no amount of JavaScript patching can produce.
This page is what Playwright actually ships today, what changed and what didn't, why the
part that remains cannot be patched, why spoofing the user agent makes it worse rather than
better, and why Firefox has no equivalent gap.
## What Playwright ships today, checked directly rather than assumed
Playwright's own browser documentation used to be the whole answer: the default managed
Chromium was an open-source build, missing the proprietary parts Google adds on top. As of
[Playwright 1.57](https://playwright.dev/docs/release-notes), that changed. The default managed binary - launched with no `channel` set
at all - is now **Chrome for Testing**, Google's own dedicated distribution for automated
testing, pinned to the Playwright version rather than auto-updating.
Chrome for Testing is not the stripped-down build the old default was. It ships the same
proprietary codec support as the Chrome a real visitor runs. Checked directly, in a live
Playwright session with no `channel` argument and no stealth layer applied: H.264 and AAC
both play. The codec half of this page's original argument no longer holds for a current,
default Playwright launch - it holds for whatever version you're actually pinned to, and it
is worth checking your own rather than assuming either answer.
## The Widevine gap that survives the switch
Checked in the same session: Widevine still rejects.
```js
await navigator.requestMediaKeySystemAccess('com.widevine.alpha', [{
initDataTypes: ['cenc'],
videoCapabilities: [{ contentType: 'video/mp4; codecs="avc1.42E01E"' }],
}]);
// current default Playwright (Chrome for Testing): rejects, NotSupportedError
```
Chrome for Testing carries Chrome's codecs but not its Widevine CDM (Content Decryption
Module) - DRM distribution has its own licensing path separate from the codec libraries,
and Google's dedicated testing distribution does not carry it. That gap is the one worth
building an argument around, because unlike the codec question, it is not a moving target
tied to which Playwright version happens to be pinned - it is a deliberate omission from a
distribution built for automation in the first place.
Here is the part that matters for anyone building or buying a stealth tool:
> **This is not a value. It is a capability.** A missing DRM module is missing machine
> code. You can lie about `navigator.userAgent` because it is a string; you cannot lie
> about whether the build can actually negotiate a Widevine session, because the page can
> ask it to and read the real answer.
This is the same distinction as
[a renderer string against the pixels a rasteriser actually draws](renderer-string-vs-render.md),
and it is the expensive class of problem for the same reason.
[The codec page](codec-fingerprinting.md) covers the wider surface; this is the sharpest
surviving instance of it, even after the part that used to accompany it closed.
## Almost nobody browses with a Widevine-less build
Almost nobody outside development, CI and automation runs a browser without Widevine.
Real people use Chrome, Edge, Brave, Opera, Vivaldi, and every one of those ships Widevine,
because a browser that cannot play protected video from a mainstream streaming service is
not a browser anybody keeps as their daily one. A build that answers "no" to the Widevine
check is a developer artefact, a CI image, or automation - not a real visitor's machine.
So the population of "sessions reporting no Widevine support" is made up overwhelmingly of
developers and automation. That is not a fingerprint value being rare. That is **a cohort
whose membership is almost entirely the thing being looked for.**
And unlike most signals in this subject, it needs no model and no scoring. It is a
capability check with a yes or no answer.
## Spoofing the user agent makes this worse
Setting the user agent to claim Chrome does not close the Widevine gap - it turns a merely
missing capability into a contradiction the page can check directly.
A stealth tool sets the user agent to claim Google Chrome. On a current, default Playwright
launch the codec set now agrees with that claim - that particular contradiction closed along
with the codec gap. The Widevine one didn't. Now the page has:
- a user agent saying **Chrome**,
- a Widevine check saying **no such CDM**,
- and in Chromium, `Sec-CH-UA` brands that
[have their own copy of the same claim](client-hints-sec-fetch.md), agreeing with the
user agent while the DRM check contradicts both.
Before the spoof, the browser was merely missing a capability real visitors have. After it,
the browser is lying about being able to do something it provably cannot, and the lie is
checkable in one line rather than inferred from a rare value. That is
[the same mistake the user agent page is about](playwright-user-agent.md), in its most
concrete remaining form.
## The `channel` escape, and what it costs
Playwright does let you opt into a branded browser:
```python
p.chromium.launch(channel="chrome")
```
That launches the real Chrome installed on the machine, with the real Widevine. It
genuinely closes the remaining gap - the one thing a current default launch, running Chrome
for Testing, still doesn't give you.
The costs are real and worth being explicit about:
- **You do not ship it.** It uses whatever Chrome is installed, at whatever version, so
your fleet is only as consistent as your machine images.
- **It updates underneath you**, on Google's schedule rather than yours.
- **It is not available everywhere**, particularly in slim containers, which is exactly
where automation runs.
- **It is still Chrome with automation attached**, so every other layer of this subject
applies unchanged.
It is the right call when you can take those costs. It is not a solved problem, it is a
traded one.
## Firefox has no equivalent gap
Firefox has no capability gap like Widevine to exploit, because it has no proprietary-versus-open
split of this kind in the first place - which is the structural reason this belongs in a
comparison rather than a list of tips.
There is no "Firefox" and
"Firefox-without-the-codecs" pair where one is what people run and the other is what
automation runs. The build Mozilla ships and a build compiled from the same source with
the release configuration have the same feature set.
So a patched Firefox is **Firefox**, in the ways a capability check can test. A patched
Chromium is **Chromium claiming to be Chrome**, and the claim is contradicted by things
that are not strings.
That is not an argument that Firefox wins overall.
[The argument against Firefox is its share of real traffic](firefox-vs-chromium-antidetect.md),
and it is serious. But on this specific axis the two engines are not in comparable
positions, and most comparisons never mention it.
## Codec and DRM support, by build
| Build | H.264 / AAC playback | Widevine DRM | What it actually is |
|---|---|---|---|
| Bare open-source Chromium (pre-1.57 default, or an explicit unbranded build) | No | No | Missing the proprietary codec and DRM additions Google adds on top of open-source Chromium |
| Chrome for Testing (Playwright's default since 1.57, no `channel` set) | Yes | No | Google's own automation distribution - Chrome's codecs, not Chrome's DRM licensing |
| Real Chrome, launched via `channel="chrome"` | Yes | Yes | The actual installed browser, with the update and install costs described above |
| Firefox, patched at the C++ level | N/A - no split | N/A - no split | One build, not two: there is no stripped variant that only automation runs |
## How to check your own build for the gap
Run this in whatever browser your automation actually launches:
```js
const v = document.createElement('video');
console.table({
h264: v.canPlayType('video/mp4; codecs="avc1.42E01E"') || 'no',
aac: v.canPlayType('audio/mp4; codecs="mp4a.40.2"') || 'no',
mp3: v.canPlayType('audio/mpeg') || 'no',
ua: navigator.userAgent,
});
navigator.requestMediaKeySystemAccess('com.widevine.alpha', [{
initDataTypes: ['cenc'],
videoCapabilities: [{ contentType: 'video/mp4; codecs="avc1.42E01E"' }],
}]).then(() => console.log('widevine: yes'), () => console.log('widevine: no'));
```
Then compare against the browser you are claiming to be, on the same machine.
- If the user agent says Chrome and H.264 comes back empty, your build predates the
Chrome for Testing default, or you launched with an explicit bare-Chromium build, and you
have the codec-level version of the contradiction described above.
- If Widevine rejects while the user agent says Chrome, that is the gap that survives even
on a current, default launch.
- If both are consistent with the claim, this particular problem is not yours - but check
which one actually changed before assuming why.
## Conclusion
The most repeated advice in Chromium-based stealth is to make the browser look like
Chrome. As of Playwright 1.57's switch to Chrome for Testing as the default, the browser
got measurably closer to actually being Chrome on the codec axis - that part of the old
advice is less wrong than it used to be. Widevine did not follow, and it remains a
capability rather than a value, which puts it out of reach of every technique that works
on the others.
The choices that actually address the remaining gap are to run real Chrome through a
branded channel and accept that you no longer control the binary, or to use an engine that
does not have the gap in the first place.
What does not address it is a better user agent string, which converts a browser that is
merely missing one capability into one that is provably lying about it.
## Short answers to the questions that lead here
**Does Playwright use Chrome or Chromium?** As of Playwright 1.57, the default managed
binary (no `channel` set) is Chrome for Testing - Google's own dedicated automation
distribution, carrying Chrome's codecs but not its Widevine CDM. Earlier Playwright
versions, or an explicit bare-Chromium build, still lack the codecs too. Branded channels
remain available as an opt-in for the rest.
**How can a website tell an automated Chromium-family browser from real Chrome today?**
Mostly by asking for Widevine DRM support, which the codec-carrying default still lacks.
The codec check that used to work for this closed as of the 1.57 default switch.
**Can I patch Widevine support in?** Not from JavaScript. A missing DRM module is missing
code, not a missing property.
**Is using a Widevine-less build suspicious?** Yes, specifically: almost the only sessions
answering "no" to that one check are developers, CI, and automation.
**Should I spoof the user agent to say Chrome?** No. On a current default launch it no
longer contradicts the codec check, but it still contradicts the Widevine one, and that
contradiction is checkable in one line.
**What about `channel="chrome"`?** It closes the remaining gap and hands you a browser you
do not ship, do not version and cannot always install.
**Does Firefox have the same problem?** No. There is no widely-used stripped Firefox that
automation runs and people do not.
**See also:** [Codec fingerprinting](codec-fingerprinting.md) for the wider surface,
[why you should not set the user agent](playwright-user-agent.md),
[Client Hints and Sec-Fetch](client-hints-sec-fetch.md) for the third copy of the same
claim, and
[Firefox or Chromium for anti-detect](firefox-vs-chromium-antidetect.md) for the argument
in both directions.
## Sources
- [Playwright's release notes](https://playwright.dev/docs/release-notes), on the switch
from custom-compiled open-source Chromium to Chrome for Testing as the default managed
binary.
- Direct capability checks run in a live Playwright session, 2026-07-30: H.264 and AAC
playable, Widevine (`com.widevine.alpha`) rejected with `NotSupportedError`, on the
default managed binary with no `channel` argument set.
- [The Encrypted Media Extensions API](https://developer.mozilla.org/en-US/docs/Web/API/Encrypted_Media_Extensions_API), for the Widevine capability check above.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. This is the argument for the engine choice that we
find most convincing, and it is the one most comparisons leave out.*
+84
View File
@@ -0,0 +1,84 @@
---
title: "CLI reference"
description: "The invisible-playwright command line: two commands, fetch and version, and what each one covers."
parent: "Documentation"
nav_order: 5
---
# CLI reference
The installed command is `invisible-playwright`, with a hyphen. `python -m
invisible_playwright` works identically and needs nothing on `PATH`.
```bash
invisible-playwright fetch # download the engine if missing, check every cached
# one against the seal, print the path
invisible-playwright version # wrapper, core and engine versions, and where the
# engine is cached
```
## `fetch`
Makes the engine present and correct, then prints where it is.
It checks every cached engine tree against the seal shipped inside
`invisible-core` **before** downloading anything. That ordering is the point: a
tree that no longer matches the seal is the case worth catching, and it is
invisible to a plain "download if missing" that only looks at whether a file is
there. Anything that does not match is reported on stderr and left alone; the
sealed engine is fetched and verified against its sha256.
The last line on stdout is the absolute path, by itself, so this is the scripting
form:
```bash
FIREFOX="$(invisible-playwright fetch)"
```
which is better than asking for a path separately, because it guarantees the
thing it names actually exists and matches the seal.
Running it when everything is already correct is cheap and does nothing.
## `version`
```
invisible_playwright 0.6.0
invisible_core 18.12.0 (declared: ==18.12.0)
engine firefox-18 Firefox 151.0 build 20260724001949
seal f294a96ae4ec [.../invisible_core/seal.json]
cache /home/you/.cache/invisible-playwright
```
This is the output to paste into a bug report. Two lines are worth knowing about:
- if the installer's record disagrees with the core that will actually run, a
`STALE RECORD` line appears between them. That is the state pip and `pip check`
both call healthy, because both read the record and neither reads the files.
- `cache` is where the engine trees live. Deleting a directory there is how you
reclaim the space; there is no subcommand for it, on purpose - see below.
## What happened to the other four
The command line used to have six entries: `fetch`, `fetch --force`, `path`,
`version`, `clear-cache`, `doctor`. Each was a step somebody had to know to take,
in a package whose whole promise is that the browser handles itself. None of the
behaviour was lost:
| gone | where it went |
|---|---|
| `doctor` | `fetch` does it on every run. It was the thing most worth doing and the thing least likely to be typed, which is the worst combination a subcommand can have. |
| `fetch --force` | unnecessary once every run verifies. A tree is replaced because it does not match the seal, not because a flag was passed. |
| `path` | `fetch` prints it as its last line, and unlike `path` it guarantees the tree is there and correct. |
| `clear-cache` | deliberately not folded in. The cache root belongs to `invisible_core`, not to this package, so pruning "trees no seal points at" would delete an engine this package did not put there. `version` prints the location. |
The `tag` argument went with them. The seal decides which engine a given build
runs, and the engine check refuses anything else, so a tag on the command line
could only ever name something that would then be rejected.
## See also
[Installation](installation.md) for the initial `fetch`, and
[Configuration](configuration.md) for the environment variables that change where
the engine is cached or which binary gets used.
+213
View File
@@ -0,0 +1,213 @@
---
title: "Client Hints and Sec-Fetch: headers that must agree"
description: "Client Hints (Sec-CH-UA) and Sec-Fetch headers come from the browser's own state, so they are cheap to compare and hard to fake. Why Firefox sits differently."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 6
---
# Client Hints and Sec-Fetch: headers that must agree
[Client Hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Client_hints) and
Sec-Fetch are two families of request headers the browser generates from
its own internal state, not from the page and not from anything you configure. That makes
them awkward to fake and very cheap to check, which is a combination detectors like.
They also catch a specific mistake: changing the user agent string and nothing else.
This page is what each family carries, the mismatches that get caught, why Firefox and
Chromium are in structurally different positions here, what automation can and cannot
control, and how to check your own.
## Client Hints: one identity in three places
Modern Chromium reports its identity in three places that come from the same internal
state:
```
Sec-CH-UA: "Chromium";v="141", "Not?A_Brand";v="8", "Google Chrome";v="141"
Sec-CH-UA-Mobile: ?0
Sec-CH-UA-Platform: "Windows"
```
```js
navigator.userAgentData.brands // the same brands and versions
navigator.userAgentData.platform // the same platform
await navigator.userAgentData.getHighEntropyValues(['platformVersion', 'architecture'])
```
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ... Chrome/141.0.0.0 ...
```
In a real browser those three agree by construction, because one piece of state produces
all of them. Comparing them is a few lines on the server and it needs no fingerprinting
library at all.
### The mismatches that get caught
- **A spoofed user agent with untouched Client Hints.** You set the string to Chrome 141
and the headers still describe whatever the browser really is. This is the single most
common version of the mistake, because changing the string is the thing every guide
tells you to do.
- **A version that differs between the two.** A current version in the user agent and an
older one in the hints is a straight contradiction.
- **A platform that differs.** Claiming Windows in the string while the hint reports the
host operating system.
- **The JavaScript API disagreeing with the headers.** Patching
[`navigator.userAgentData`](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData)
in the page does nothing to the headers, which were sent before your script existed.
That last one is worth sitting with. The headers travel with the request. A page-level
override cannot reach them, ever, because they were already sent.
## Firefox is in a different position, in both directions
Firefox does not implement User Agent Client Hints. It sends no `Sec-CH-UA` headers and
has no `navigator.userAgentData`.
That cuts two ways and both are worth being explicit about.
**In your favour, if you are actually Firefox.** There is no second identity pipeline to
keep synchronised. The absence is correct, expected, and matches every other real Firefox
on the internet. The whole class of mismatch above simply does not apply.
**Against you, if you claim to be Chrome.** A request whose user agent says Chrome and
which carries no Client Hints at all is contradicted by its own headers. There is no way
to fix that from inside a Firefox, because you would have to implement the pipeline.
So "which browser should I claim" is not a free choice. Claim the one you are running.
[Which is the argument for not setting the user agent at all](playwright-user-agent.md).
## Sec-Fetch: how the request was initiated
[Sec-Fetch](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Site)
is a separate family of headers, present in every modern browser including
Firefox, that describes how a request was initiated rather than what the browser is. It is
much less discussed than Client Hints, and just as cheap for a server to check.
```
Sec-Fetch-Site: same-origin | same-site | cross-site | none
Sec-Fetch-Mode: navigate | cors | no-cors | same-origin
Sec-Fetch-Dest: document | image | script | style | empty
Sec-Fetch-User: ?1 (only present when a user activated the navigation)
```
These describe **the circumstances of the request**, not the browser. The browser fills
them in from what it knows: where the request came from, what it is for, and whether a
user gesture triggered it.
Why that is interesting for automation:
- A top-level navigation typed into the address bar carries `Sec-Fetch-Site: none`. One
that came from clicking a link on the same site carries `same-origin`. A request
fabricated outside the normal flow can easily carry the wrong one.
- `Sec-Fetch-User: ?1` appears only when the navigation was user activated. Automation
that clicks properly produces it; automation that navigates programmatically does not,
and a page that expected a click can notice the difference.
- `Sec-Fetch-Dest` has to match what the request is actually for. A document request that
claims to be an image is not a browser.
The connection to the rest of this subject: user activation is also readable in the page,
through `navigator.userActivation`, and it is the value that
[an automation driver can announce by accident](debugger-timing-detection.md). Getting
that wrong in either direction, claiming a gesture nobody made or lacking one a real flow
would have, is the same class of inconsistency as everything else here.
## What automation can and cannot control
The practical division:
**Cannot be set from the page.** All of it. These headers are constructed by the network
stack when the request is made. Anything you do in JavaScript happens after.
**Can be set by the automation layer**, badly. Most frameworks let you add or override
request headers. Overriding these by hand is how you produce a set that no real browser
sends, because you are now maintaining by hand something the browser was maintaining
correctly.
**Should be left alone.** That is the whole recommendation. If the browser is real and
you have not overridden its identity, both families are correct for free.
The one legitimate case is adding headers a site requires for its own API, which is
unrelated to identity and does not touch either family.
## Checking your own
Send a request to any service that echoes headers back and read the full set, then
compare against what the same page reports in JavaScript.
```js
// in the page
console.log(navigator.userAgent);
console.log(navigator.userAgentData); // undefined in Firefox, and that is correct
if (navigator.userAgentData) {
console.log(await navigator.userAgentData.getHighEntropyValues(
['platformVersion', 'architecture', 'model', 'uaFullVersion']));
}
```
What you want:
- If `navigator.userAgentData` exists, its brands, version and platform match both the
user agent string and the `Sec-CH-UA` headers on the request.
- If it does not exist, no `Sec-CH-UA` headers are being sent either, and the user agent
claims a browser that genuinely does not send them.
- `Sec-Fetch-Site` matches how you actually navigated.
- `Sec-Fetch-User` is present when you clicked and absent when you navigated
programmatically.
- Header **order** matches a real browser's, [a separate surface](http2-fingerprint-detection.md)
one layer down, and one more reason not to hand-assemble any of this.
## Conclusion
These headers are hard to fake for a good reason: the browser generates them from state
it already has, so a real browser is consistent without trying and a spoofed one has to
maintain three copies of an identity by hand.
The practical advice is short. Do not override the user agent, so there is nothing to
keep in sync. Do not hand-set these headers. Claim the browser you are actually running,
because Firefox not sending Client Hints is correct for Firefox and damning for something
claiming to be Chrome.
## Short answers to the questions that lead here
**What is `Sec-CH-UA`?** A request header carrying the browser's brand and version,
generated from the same internal state as the user agent string.
**Why do Client Hints give away a spoofed user agent?** Because changing the string does
not change the headers, so the two describe different browsers.
**Does Firefox send Client Hints?** No, and it has no `navigator.userAgentData`. That is
correct for Firefox and a contradiction for anything claiming to be Chrome.
**Can I set Client Hints from JavaScript?** No. The headers are sent before your script
runs.
**What is `Sec-Fetch-User`?** A header present only when a user gesture triggered the
navigation.
**Should I override these headers in my automation?** No. A real browser fills them in
correctly, and hand-maintaining them is how you produce a combination that does not
exist.
**See also:** [why you should not set the user agent](playwright-user-agent.md), which is
the same argument from the other end,
[JA3 and JA4](ja3-ja4-tls-fingerprint.md), for the layer below these headers, and
[how to test whether your browser is detected](how-to-test-bot-detection.md).
## Sources
- The User Agent Client Hints headers and `navigator.userAgentData`, as implemented in
Chromium and absent in Firefox.
- The Fetch Metadata request headers, `Sec-Fetch-Site`, `-Mode`, `-Dest` and `-User`.
- This project's handling of user activation, which is described on
[the debugger page](debugger-timing-detection.md).
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. Running a real Firefox means the Client Hints
question answers itself, which is the kind of advantage you only get by not lying in the
first place.*
+199
View File
@@ -0,0 +1,199 @@
---
title: "Codec fingerprinting: canPlayType and MediaCapabilities"
description: "Codec fingerprinting: the formats a browser claims to play reveal its build and platform; whether decoding is power efficient reveals the machine behind it."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 7
---
# Codec fingerprinting: canPlayType and MediaCapabilities
Codec fingerprinting identifies a browser by which media formats it claims it can
decode, and identifies the machine underneath by how efficiently it decodes them. Ask a
browser what video formats it can play and the answer is not about the person using it.
It is about the build, the operating system underneath, and increasingly the hardware,
which makes it three separate fingerprinting surfaces wearing one API.
It is also one of the surfaces nobody checks after spoofing everything else, which is
what makes it worth a page.
## What the two APIs actually return
Two APIs answer the "what can you play" question, from two different eras of the
platform: the old `canPlayType()` returns a vague string, the modern
`mediaCapabilities.decodingInfo()` returns a structured verdict including whether
decoding is power efficient. The old one is deliberately vague:
```js
const v = document.createElement('video');
v.canPlayType('video/mp4; codecs="avc1.42E01E"'); // "probably", "maybe", or ""
v.canPlayType('video/webm; codecs="vp9"');
v.canPlayType('audio/mpeg');
```
Three possible answers: `probably`, `maybe`, or an empty string. The vagueness is
historical, and it does not reduce the information much, because what matters is the
**pattern across a list of types**, not any single verdict.
The modern one is far more revealing:
```js
await navigator.mediaCapabilities.decodingInfo({
type: 'file',
video: { contentType: 'video/mp4; codecs="avc1.42E01E"',
width: 1920, height: 1080, bitrate: 3000000, framerate: 30 }
});
// { supported: true, smooth: true, powerEfficient: true }
```
Note the third field. That is the interesting one and the rest of this page is largely
about it.
## Codec support identifies the build and the platform
Which codecs a browser supports depends on how it was compiled and what the operating
system provides. Some formats are handled by the browser's own decoders, others are
delegated to the platform, and licensing means builds differ.
The practical consequences:
- **Different browsers give different patterns**, which is how codec probing is used for
plain browser identification, independently of the user agent.
- **The same browser version on different operating systems gives different patterns**,
because the platform decoders differ. A Linux build and a Windows build of the same
Firefox are not identical here.
- **Stripped builds differ from consumer builds.** A minimal container image may lack
system codecs that a desktop install has.
That third point is the one that bites automation. Claiming Windows while returning the
codec profile of a slim Linux container is the same class of contradiction as
[claiming Windows with a Linux font set](headless-fonts-differ.md), and it is checked
the same way: by comparison, not by rarity.
## powerEfficient is a hardware question, not a codec question
`powerEfficient` reports whether decoding a given stream would use hardware
acceleration, which is what turns this from a browser-identification surface into a
machine one. On a desktop with a modern GPU, common formats decode in dedicated silicon
and the answer is `true`. On a machine with no GPU, everything decodes on the CPU and the
answer is `false` for formats a real desktop would accelerate.
So this API answers, in one field, the same question as
[a software WebGL renderer](webgl-renderer-strings.md),
[an empty speech voice list](speech-synthesis-voices.md) and
[a missing audio device](audiocontext-fingerprinting.md): is this a person's computer or
a server.
And `smooth` adds a second dimension, since it reflects whether the machine can decode
that resolution and framerate in real time.
Nobody lists `decodingInfo` in a stealth checklist. It costs one `await`.
## Why randomising codec support is the wrong instinct
The reflex is to vary the answers per session. That is the same
mistake as
[randomising WebGL numeric parameters](webgl-parameters-are-identical.md), and it fails
for the same reason.
Codec support is not a per-user setting. Everyone running a given browser build on a
given platform reports the same pattern, which means the pattern is a **cohort**, and the
crowd is the disguise. A browser reporting a combination of supported and unsupported
formats that no real build produces is not blending in, it has invented a build that does
not exist.
Nor should the values move between page loads. A browser that supports AV1 on one load
and not the next is describing software that reinstalled itself mid-session.
The defensible approach is the one used for the other hardware-shaped values in this
project: sample the codec profile **together with the machine class**, from combinations
that occur, so a low-end integrated-graphics identity does not claim the codec profile of
a workstation. It is one of four dimensions sampled jointly rather than independently,
alongside the audio profile, the storage quota and the antialiasing level, precisely so
they cannot contradict each other.
## Checking your own
```js
const v = document.createElement('video');
const types = [
'video/mp4; codecs="avc1.42E01E"',
'video/mp4; codecs="hev1.1.6.L93.B0"',
'video/webm; codecs="vp8"',
'video/webm; codecs="vp9"',
'video/mp4; codecs="av01.0.05M.08"',
'audio/mpeg', 'audio/ogg; codecs="opus"', 'audio/mp4; codecs="mp4a.40.2"',
];
console.table(Object.fromEntries(types.map(t => [t, v.canPlayType(t) || 'no'])));
const info = await navigator.mediaCapabilities.decodingInfo({
type: 'file',
video: { contentType: 'video/mp4; codecs="avc1.42E01E"',
width: 1920, height: 1080, bitrate: 3000000, framerate: 30 },
});
console.log(info); // watch powerEfficient
```
What you want to see:
- The pattern matches a stock browser of the same version **on the platform you claim**,
not on the platform you are running.
- `powerEfficient` is `true` for mainstream formats if you are claiming a desktop.
- The answers are identical on a reload and on a relaunch of the same identity.
- Nothing exotic is supported that the claimed build does not support.
The first and second are the ones that fail on a server, and neither is fixed by anything
at the JavaScript layer.
## Conclusion
Codec probing is cheap, unglamorous and rarely audited. It carries three different kinds
of information at once: which browser you are, which platform you are on, and whether
your machine has a video decoder.
The first two are fixed by making the answers match the build and platform you claim.
The third is the familiar one: a machine with no GPU says so, in yet another place, and
the only real fixes are the same as everywhere else.
## Short answers to the questions that lead here
**Is `canPlayType` used for fingerprinting?** Yes, as a pattern across a list of types
rather than as a single answer. It identifies the browser and the platform.
**What does `powerEfficient` reveal?** Whether decoding would be hardware accelerated,
which is a statement about the machine rather than the codec.
**Should I spoof codec support?** Match it to the build and platform you claim. Do not
randomise it, and do not let it vary between page loads.
**Why do Linux and Windows builds differ?** Because some decoding is delegated to the
platform, and the platforms provide different things.
**Does `privacy.resistFingerprinting` cover this?** Firefox has worked on standardising
these answers under that mode, which is one more way of being identifiable as someone
running that mode. There is
[a longer page on that trade](resist-fingerprinting.md).
**Is this checked in practice?** It is cheap enough that assuming it is checked costs you
nothing, and it is one `await` to verify on your own setup.
**See also:** [screen size and viewport tells](screen-size-headless-tells.md),
[hardwareConcurrency, deviceMemory and storage quota](hardware-concurrency-device-memory.md)
and [Playwright in Docker](playwright-docker-detection.md), which are the rest of the
"what the machine says about itself" family.
## Sources
- MDN, [`HTMLMediaElement.canPlayType`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType)
and the [Media Capabilities API](https://developer.mozilla.org/en-US/docs/Web/API/MediaCapabilities_API).
- Firefox's own tracking of standardising these answers under resist-fingerprinting.
- This project's codec profile, sampled jointly with the machine class rather than
independently, for the reason given above.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. The joint sampling is the same decision made for
audio, storage quota and antialiasing, and for the same reason: independently sampled
dimensions contradict each other.*
@@ -0,0 +1,215 @@
---
title: "Color-gamut and HDR media queries as a fingerprint"
description: "Color-gamut and HDR media features expose display capability without JavaScript. Why they must align with screen.colorDepth and what misalignment reveals."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 28
---
# Color-gamut and HDR media queries as a fingerprint
Most of the fingerprint surfaces people worry about live in JavaScript: `navigator`,
canvas, WebGL, audio. This one does not. The [`color-gamut`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut), [`dynamic-range`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/dynamic-range) and
[`video-dynamic-range`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/video-dynamic-range) media features describe what a display can show, and a page can
read them from CSS alone, before a single line of script runs. That makes them a
quiet consistency check: they have to agree with everything your JavaScript says about
the same screen, and nothing you set in code touches them.
This page is what those features report, why they are read from a different code path
than `screen.colorDepth`, the disagreement that gives a browser away, and how
invisible_playwright keeps the two sides telling one story. It answers the question in
the title honestly: matching these features helps you look like a real display, and it
does nothing for your IP or your pacing.
## What color-gamut and dynamic-range actually report
Three CSS media features describe a display's color and brightness capability:
- `color-gamut` reports the range of color the output can render, as one of `srgb`,
`p3` or `rec2020`. A page tests it with `@media (color-gamut: srgb) { ... }` or from
script with `matchMedia("(color-gamut: p3)")`.
- `dynamic-range` reports whether the display and the browser can show high dynamic
range content, as `standard` or `high`.
- `video-dynamic-range` is the same question aimed specifically at video output, and
can differ from `dynamic-range` on hardware that treats the two paths separately.
None of these needs JavaScript to be readable. A stylesheet can branch on them and a
detector can observe which branch applied, so they are live even on a page that runs
no script at all. This puts them in the same family as the
[CSS media features documented for dark mode and pointer type](css-media-query-fingerprinting.md),
and distinct from them in what they describe: not a user preference, but a hardware
property of the panel.
The values are not free-floating. A real Windows laptop with a standard sRGB panel
reports `color-gamut: srgb` and `dynamic-range: standard`, and it reports a
`screen.colorDepth` of 24 to match. Those two facts come from the same physical
display, so on real hardware they never contradict each other. That is the whole
point of the surface for a detector.
## Why this is read from a different code path than colorDepth
Here is the trap. `screen.colorDepth` is a JavaScript property. The color-gamut media
feature is resolved by the CSS engine when it evaluates a media query. A page can read
both, and it can compare them, but they arrive through two entirely separate paths
inside the browser.
That separation is exactly what a consistency detector wants. If a stealth layer
overrides `screen.colorDepth` in JavaScript to report a plausible 24-bit display, but
the CSS side still resolves `color-gamut` against whatever the underlying environment
actually has, the two disagree. One code path was patched and the other was not. A
real browser cannot produce that disagreement, because both values are read off the
same panel. So a page that finds `screen.colorDepth: 24` next to a `color-gamut` that
resolves to something else has found a browser whose two halves were configured
independently, which is a tell that no single value would have given up.
The same shape shows up in
[the platform and oscpu strings that have to agree with the user agent](navigator-platform-oscpu-consistency.md):
individually every value is plausible, and the fingerprint is in whether they line up.
A JavaScript-only spoof can set the property a page reads first, and miss the second
surface that reports the same underlying fact through CSS.
## Why a page-level override cannot fix this
If your approach to fingerprinting is injecting JavaScript, this surface is a problem,
because there is nothing in JavaScript's gift to change here. You can redefine
`matchMedia` to lie about `color-gamut`, but redefining a built-in is itself one of
the loudest tells there is: [CreepJS](how-to-test-bot-detection.md) walks descriptors
and prototypes and records a patched built-in by name. And even if you patch
`matchMedia`, the pure-CSS path that applies a `@media (color-gamut: ...)` rule
without ever calling script is still resolving against the real value. You cannot
intercept a stylesheet branch from a `matchMedia` override.
The only place this can be made consistent is below JavaScript, where the CSS engine
and the `screen` object read the same display description. invisible_playwright is a
Firefox patched at the C++ level rather than a script injected into a stock browser,
so the display it presents is a single coherent object: the color-gamut media feature,
`dynamic-range`, `video-dynamic-range` and `screen.colorDepth` all resolve from one
plausible Windows sRGB display, the way they do on the real Firefox it is built from.
There is no second code path left unpatched, because the value is not being faked at
the property level at all.
This is the same reason [an impossible screen geometry](screen-size-headless-tells.md)
survives every page-level spoofer: the surfaces that describe the physical display are
not the ones a script can reach.
## Reading it yourself
The `browser` returned by invisible_playwright is a real Playwright `Browser`, so you
read these features the same way you would in any Playwright script. Launch, open a
page, and evaluate the media queries plus the property they have to agree with:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
report = page.evaluate("""() => ({
colorGamut:
matchMedia('(color-gamut: rec2020)').matches ? 'rec2020' :
matchMedia('(color-gamut: p3)').matches ? 'p3' :
matchMedia('(color-gamut: srgb)').matches ? 'srgb' : 'unknown',
dynamicRange:
matchMedia('(dynamic-range: high)').matches ? 'high' : 'standard',
videoDynamicRange:
matchMedia('(video-dynamic-range: high)').matches ? 'high' : 'standard',
colorDepth: screen.colorDepth,
pixelDepth: screen.pixelDepth,
})""")
print(report)
# {'colorGamut': 'srgb', 'dynamicRange': 'standard',
# 'videoDynamicRange': 'standard', 'colorDepth': 24, 'pixelDepth': 24}
```
The check that matters is not any single line of that output. It is that
`colorGamut: 'srgb'` and `colorDepth: 24` describe the same display, and would still
describe the same display if you read them again in the next session. Because the
identity is derived from the seed, passing `seed=42` gives you the same display every
run, so this is a value you can assert on in a test rather than a moving target. The
[reproducible-fingerprint workflow](quickstart.md) is what makes that assertion stable.
Run it against a stock Firefox on the same machine and diff the two reports field by
field. On a real desktop panel they match. The point of the exercise is to confirm the
patched build sits on the same side of that diff as the real browser, not on the
overcorrected side where a spoof reports a `p3` display no one asked for.
## The honest limit
This makes your browser's display self-consistent. It is worth being precise about
what that does and does not buy you.
Color-gamut and dynamic-range are properties of the browser and its claimed hardware.
Getting them right removes one way a page distinguishes a real display from a patched
one, and it removes it at the layer where it actually lives rather than papering over
it in script. That is a real part of why invisible_playwright reads as a genuine
Firefox to fingerprint, TLS and driver-layer checks.
It is not the whole session. These media features say nothing about where your traffic
exits or how fast you send it. A perfectly consistent sRGB display on a datacenter
address that a scoring service already knows is still on a known address. A browser
that fills a form in eighty milliseconds still moves like no human, whatever its
color-gamut reports. invisible_playwright does not touch IP reputation, per-account
quotas, rate limits, or the timing of your actions, and it does not claim to. Those
you supply: a clean residential proxy, human pacing, one account doing one plausible
amount of work. The fingerprint is the part that is hard to get right by hand, and it
is the part this tool owns; the rest of the session is still yours.
## Conclusion
Color-gamut, dynamic-range and video-dynamic-range are a display fingerprint that
lives in CSS, readable with no JavaScript, and they have to agree with the
`screen.colorDepth` a page reads from script through a completely separate code path.
A page-level override touches one path and leaves the other reporting the real
environment, which is a contradiction a real browser never produces. invisible_playwright
presents a single coherent Windows sRGB display across both paths because it is patched
below JavaScript, and it keeps that display stable across runs when you pin the seed.
That is worth exactly what it is worth: a browser that looks real, on top of an exit
and a rhythm you still have to get right yourself.
## Short answers to the questions that lead here
**Can a website read my display's color gamut without JavaScript?** Yes. The
`color-gamut` media feature is resolved by the CSS engine, so a stylesheet can branch
on it and observe the result before any script runs.
**What is the trap with color-gamut and screen.colorDepth?** They describe the same
physical display but are read through different code paths. If a spoof patches one and
not the other, they disagree, which a real browser never does.
**Can I fix this by overriding matchMedia?** No. Redefining a built-in is itself a
loud tell, and it still does not touch the pure-CSS path that applies a
`@media (color-gamut: ...)` rule without calling script.
**What does invisible_playwright report for these features?** A plausible, consistent
Windows sRGB display: `color-gamut: srgb`, `dynamic-range: standard`, and a matching
24-bit `screen.colorDepth`, the same as the real Firefox it is built from.
**Does matching these features make me undetectable?** No. It makes your display
self-consistent. It does nothing for your IP reputation, your rate limits or your
behaviour, which you still have to handle with a clean proxy and human pacing.
**Will the same seed give the same color-gamut every run?** Yes. The display is derived
from the seed, so `seed=42` reports the same values every session, which is what lets
you assert on them in a test.
## Sources
- The [Media Queries Level 5 specification](https://www.w3.org/TR/mediaqueries-5/),
which defines `color-gamut`, `dynamic-range` and `video-dynamic-range` and their
resolution from the output device.
- This project's fingerprint gates, which cross-check the CSS-resolved display
features against `screen.colorDepth` and the canvas and WebGL persona for the same
seed.
**See also:** [CSS media features as a fingerprint surface](css-media-query-fingerprinting.md),
[keeping navigator.platform and oscpu consistent](navigator-platform-oscpu-consistency.md),
and [screen sizes that give a headless machine away](screen-size-headless-tells.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The color-gamut and
colorDepth disagreement is one I would rather find in my own diff than have a page find
for me.*
@@ -0,0 +1,211 @@
---
title: "Combine invisible_playwright with httpx for speed"
description: "Clear the fingerprint-gated entry in a real browser, export storage_state, then hand the cookies to httpx for cheap high-volume follow-up requests - and the sharp limit."
parent: "Scraping with Playwright"
grand_parent: "Guides"
nav_order: 89
---
# Combine invisible_playwright with httpx for speed
A browser is expensive. It starts a process, renders a page, runs the site's
JavaScript, and holds memory the whole time. If you need one page a minute that is fine.
If you need a thousand JSON responses from an endpoint the site already exposes, paying
browser cost for each one is the slow way to do it.
The fast way is a split: use the browser for the part that needs a browser, and use a
bare HTTP client for the part that does not. This page shows the handoff concretely -
export the session the browser established, hand it to `httpx`, and let `httpx` do the
bulk - and it is equally clear about the one boundary where the trick stops working,
because that boundary is the whole skill.
## Why the browser clears the door and httpx does not
`invisible_playwright` is a Firefox patched at the C++ level and driven by stock
Playwright. It is built to look like a real browser driven by a real person: the
fingerprint, the TLS handshake and the driver layer all read as a genuine Firefox, which
is why it clears the checks that turn plain automation away at the door. That is the
part you cannot fake with a bare HTTP client. An endpoint that inspects the JavaScript
fingerprint, or reads the TLS handshake, expects a browser to be on the other end.
`httpx` is the opposite tool on purpose. It is a fast, async-capable Python HTTP client
with no JavaScript engine and no browser TLS stack. It sends a plain client handshake and
whatever headers you give it, and nothing else. That is exactly why it is cheap, and
exactly why it cannot pass a fingerprint check. It has no fingerprint to present.
So the division is not a hack, it is the honest shape of the problem. The browser is for
the fingerprint-gated fetches. `httpx` is for the unguarded bulk. Knowing which endpoint
is which is the entire exercise, and most of this page is about telling them apart.
## Establish the session in the browser
First, do the guarded part properly: launch the real browser, clear whatever gates the
entry (a login, a challenge page, a first navigation that sets a session cookie), and let
it settle. Switching from plain Playwright is two lines, and the object you get back is a
real Playwright `Browser`, so every method below is the stock API:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42, proxy={
"server": "socks5://gate.example.com:1080",
"username": "u", "password": "p",
}) as browser:
page = browser.new_page()
page.goto("https://example.com/app")
# ... do whatever establishes the session: submit a form, pass an
# interactive check, land on the page that issues the session cookie ...
page.wait_for_load_state("networkidle")
```
The seed is not decoration here. It pins the identity, so the fingerprint that created
this session is reproducible - which matters the moment you reuse the session, because a
reused session is still tied to the machine that created it. That coupling is the subject
of [why reusing a session beats re-automating the login form](automating-login-vs-session-reuse.md).
## Export storage_state and hand it to httpx
Playwright already has the export you need.
[`context.storage_state()`](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-storage-state)
returns the cookies and local storage the session accumulated, in a plain dict. Capture it
while the browser is still open:
```python
state = page.context.storage_state()
# state == {"cookies": [{"name": ..., "value": ..., "domain": ...}, ...],
# "origins": [{"origin": ..., "localStorage": [...]}, ...]}
```
Now the browser has done its job. Everything after this can happen in a cheap client. Map
the cookies into an `httpx.Client` and fire the follow-up requests concurrently:
```python
import httpx
cookies = httpx.Cookies()
for c in state["cookies"]:
cookies.set(c["name"], c["value"], domain=c["domain"], path=c.get("path", "/"))
# route httpx through the SAME exit the browser used, see the caveat below
proxy = "socks5://u:p@gate.example.com:1080"
with httpx.Client(cookies=cookies, proxy=proxy, http2=True,
headers={"User-Agent": page.evaluate("navigator.userAgent")}) as client:
for page_num in range(1, 200):
r = client.get(f"https://example.com/api/items?page={page_num}")
r.raise_for_status()
handle(r.json())
```
Two hundred JSON pages just came back without starting two hundred browsers. If the bulk
endpoint returns the same data the page renders, this is also the moment to stop parsing
HTML and read the response directly, the same idea covered in
[capturing XHR and API responses](how-to-capture-xhr-api-responses-playwright.md).
## The boundary: any endpoint that re-checks the fingerprint rejects the httpx leg
Here is the sharp edge, and it is not negotiable. `httpx` carries the cookies but sends
no browser fingerprint. It presents a plain TLS handshake and no JavaScript surface at
all. So the handoff works on exactly one kind of endpoint: one that trusts the cookie and
does not re-inspect the caller.
Plenty of endpoints are like that. A paginated data API behind a session cookie, a
download URL, an internal JSON route the page itself calls - these usually check that you
hold a valid session and nothing more. The `httpx` leg sails through.
But some endpoints re-run the check on every request. They read the TLS handshake, or
require a token that only the site's JavaScript can mint, or expect a browser-shaped
request signature alongside the cookie. Against those, the cookie is necessary but not
sufficient, and the bare client is refused - often with a `403` or a challenge page
where the browser got JSON. There is no client-side trick that gives `httpx` a browser
handshake; if the endpoint re-checks the fingerprint, that endpoint stays in the browser.
The way you find the boundary is empirical and cheap: send one `httpx` request to the
target endpoint with the exported cookies. If it returns the same body the browser got,
that endpoint is safe to bulk. If it returns a challenge, an error, or a suspiciously
short body, it is a re-checked endpoint and it belongs in the browser leg. Test one
before you loop over a thousand.
## What this speeds up, and what it does not touch
The split is a cost optimization, not a stealth upgrade. It makes a workload cheaper by
moving the unguarded requests off the browser. It does nothing for the four things that
block sessions independently of the fingerprint, and moving traffic to `httpx` can make
some of them worse if you are not careful:
- **IP reputation.** Route `httpx` through the same clean exit the browser used. If the
bulk requests go out from your datacenter host directly while the browser used a
residential proxy, you have split the session across two addresses, which is its own
signal. Same exit for both legs.
- **Rate limits and per-account quotas.** Two hundred requests in two seconds from one
session is a velocity signal no fingerprint hides. Pace the `httpx` loop. The browser
being invisible does not raise the account's quota.
- **Timezone and locale consistency.** The session was created with a browser identity
tied to the exit; keep the follow-up on the same exit so the story stays coherent, the
same failure mode described in [timezone and proxy mismatch](timezone-proxy-mismatch.md).
- **Behaviour on the guarded leg.** The browser still has to pass the guarded entry
convincingly. The speed trick only applies after that door is open.
`invisible_playwright` gives you the browser that looks real. You supply the clean exit,
the human pacing, and the judgement about which endpoints can leave the browser. The tool
does one job well and is honest about the rest.
## Conclusion
The hybrid pattern is simple once the boundary is clear. The browser establishes the
session because only a browser presents a real fingerprint and TLS handshake. You export
`storage_state`, hand the cookies to `httpx`, and let the cheap client do the
high-volume follow-up - but only against endpoints that trust the cookie and do not
re-inspect the caller. The moment an endpoint re-checks the fingerprint, that request
goes back into the browser, where the fingerprint lives. Test one request before you loop,
keep both legs on the same clean exit, and pace the bulk. That is the whole method.
## Short answers to the questions that lead here
**Can I do all my scraping with httpx and skip the browser?** Only for endpoints that do
not check a fingerprint. The browser exists to clear the ones that do; `httpx` has no
fingerprint to present, so anything that re-checks one will refuse it.
**How do I move a logged-in session from the browser to httpx?** Call
`page.context.storage_state()` while the browser is open, then set its cookies on an
`httpx.Client`. The cookies carry the session; the handshake does not.
**Why does httpx get a 403 where the browser got JSON?** That endpoint re-checks the
caller, not just the cookie. It reads the TLS handshake or wants a browser-minted token.
Keep that request in the browser.
**Do I need the same proxy for both legs?** Yes. Split the session across two exit
addresses and you have created a mismatch signal. Route `httpx` through the same exit the
browser used.
**Does this make me undetectable?** No, and nothing does. It is a speed optimization. It
does not fix IP reputation, account quotas, rate limits, or behaviour - you supply a
clean exit and human pacing for those.
**How do I know which endpoints are safe to bulk?** Send one `httpx` request with the
exported cookies and compare the body to what the browser got. Same body, safe to loop.
Challenge or short body, keep it in the browser.
## Sources
- The real `invisible_playwright` API as documented in
[Quickstart](quickstart.md) and [Configuration](configuration.md): the two-line launch,
the reproducible seed, and the proxy dict both legs must share.
- Playwright's own
[`context.storage_state()`](https://playwright.dev/python/docs/api/class-browsercontext#browser-context-storage-state),
which returns cookies and local storage as a plain dict, working exactly as documented
upstream because the object handed back is a real Playwright `Browser`.
- This project's own practice of testing one request against the boundary before looping,
the same empirical habit the rest of these notes are built on.
**See also:** [why reusing a session beats re-automating the login](automating-login-vs-session-reuse.md)
and [how to capture XHR and API responses](how-to-capture-xhr-api-responses-playwright.md)
for reading the JSON the page already fetches.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser is for the
fingerprint-gated fetches, httpx is for the unguarded bulk, and telling them apart is the
whole job.*
+68
View File
@@ -0,0 +1,68 @@
---
title: "Comparisons"
description: "invisible_playwright against the closest alternatives at each layer - Camoufox, Patchright, nodriver, playwright-stealth - plus the engine question underneath all of them: Firefox or Chromium."
has_children: true
nav_order: 4
---
# Comparisons
Most comparisons in this space put tools side by side that are not actually
comparable: a page-level script against a patched binary, a Chromium tool against a
Firefox one. These pages try not to do that. Each one names the layer the comparison
actually happens at, states plainly where the other tool covers more, and does not
claim an advantage it could not verify against the other project's own source or
documentation.
Start with [Three ways to make Playwright undetected](playwright-stealth-levels.md)
if you want the map before the individual matchups - it's the frame every comparison
below sits inside.
## Concepts and the map
- [Three ways to make Playwright undetected](playwright-stealth-levels.md) - The three levels stealth tools work at - page, driver, engine - and what each reaches.
- [Firefox or Chromium for anti-detect automation](firefox-vs-chromium-antidetect.md) - No CDP surface and one identity, traded against Firefox's smaller traffic share.
- [Chromium is not Chrome, and detectors know the difference](chromium-is-not-chrome.md) - Chrome for Testing plays H.264 but fails a Widevine DRM check no patch closes.
- [WebDriver BiDi vs CDP: does the new protocol hide you](bidi-vs-cdp-detection.md) - BiDi standardizes the control wire, but automation leaks live in the page, not the protocol.
- [Do I need an anti-detect browser or just Playwright?](do-i-need-an-antidetect-browser.md) - What a paid anti-detect GUI adds over stock Playwright driving a patched Firefox.
- [Migrating from Puppeteer to Playwright for stealth](migrate-puppeteer-to-playwright-stealth.md) - The near one-to-one API mapping, and what changes for detection off the CDP stack.
- [Migrating from Selenium to Playwright for stealth](migrate-selenium-to-playwright-stealth.md) - Map driver.get and find_element to page.goto and locators, dropping the WebDriver server.
## Patched-engine, driver-patch and stealth-plugin tools
- [invisible_playwright vs Camoufox: two patched Firefoxes](vs-camoufox.md) - Both patch Firefox in C++; how each builds its fingerprint and whether a run replays.
- [invisible_playwright vs Patchright: driver vs engine](vs-patchright.md) - Patchright patches the Playwright driver on Chromium; this patches Firefox itself. Often you need both.
- [invisible_playwright vs rebrowser-patches: the same CDP fix](vs-rebrowser-patches.md) - Fixes the Runtime.enable CDP leak on Chromium; reaches neither Firefox nor fonts, GPU, canvas, audio.
- [undetected-playwright vs a patched Firefox binary](vs-undetected-playwright.md) - Hides Playwright's init-script and bindings tells; a patched Firefox closes the fingerprint layer.
- [invisible_playwright vs playwright-stealth: page vs engine](vs-playwright-stealth.md) - playwright-stealth patches the page in about four lines; this rebuilds the engine.
- [playwright-extra stealth plugins vs a patched browser](vs-playwright-extra-stealth.md) - Applies stealth plugins as injected JavaScript a detector reads back; a patched engine compiles them in.
- [invisible_playwright vs fingerprint-suite: injection vs engine](vs-fingerprint-suite.md) - fingerprint-suite injects a generated fingerprint into a page; this sets it in the engine.
- [invisible_playwright vs playwright-with-fingerprints](vs-playwright-with-fingerprints.md) - Injects remote-service fingerprints into a Windows-only, ageing Chromium build, and what that trade costs.
- [puppeteer-real-browser vs invisible_playwright](vs-puppeteer-real-browser.md) - Node plus real Chrome with runtime property patches vs Python plus Firefox with compiled spoofs.
## CDP and driverless Chrome tools
- [invisible_playwright vs nodriver and undetected-chromedriver](vs-nodriver.md) - Chrome-only tools, not Playwright forks; neither hides IP or fingerprint, by their own docs.
- [pydoll vs invisible_playwright: CDP without a driver](vs-pydoll.md) - pydoll drives Chrome over CDP with no chromedriver; this ships seed-consistent Firefox surfaces.
- [zendriver vs invisible_playwright: Chrome CDP vs Firefox](vs-zendriver.md) - zendriver drives Chrome over CDP; this drives a patched Firefox with cross-checked surfaces.
- [selenium-driverless vs invisible_playwright stealth](vs-selenium-driverless.md) - Drops chromedriver by driving Chrome over raw CDP but leaves rendering and TLS stock.
- [invisible_playwright vs SeleniumBase UC Mode](vs-seleniumbase-uc-mode.md) - UC Mode detaches chromedriver but never changes the engine, GPU, fonts, canvas or TLS.
- [undetected-chromedriver vs a patched Firefox browser](vs-undetected-chromedriver.md) - Strips the driver's cdc_ and webdriver leaks but ships a stock Chromium fingerprint.
- [invisible_playwright vs Ulixee Hero](vs-ulixee-hero.md) - Replayed emulation on stock Chromium vs a fingerprint decided natively in patched Firefox.
## Non-Playwright frameworks and HTTP-client libraries
- [botasaurus vs invisible_playwright: framework vs library](vs-botasaurus.md) - Batteries-included Chrome scraping framework vs a patched-Firefox engine driven with stock Playwright.
- [invisible_playwright vs Scrapling](vs-scrapling.md) - Scrapling is an adaptive parser, not a stealth engine; its ceiling is whichever browser it wraps.
- [scrapy-playwright vs a patched Firefox for stealth](vs-scrapy-playwright.md) - Runs stock Playwright inside Scrapy; point the handler at a patched Firefox and keep the scheduler.
- [invisible_playwright vs DrissionPage](vs-drission-page.md) - Fuses an HTTP session mode and a CDP browser mode, each failing a different check half.
- [curl_cffi vs invisible_playwright: TLS client vs browser](vs-curl-cffi.md) - Replays a browser's TLS and HTTP/2 at byte level but runs no JavaScript.
- [invisible_playwright vs hrequests](vs-hrequests.md) - A hybrid TLS-impersonating HTTP client plus a browser mode with injected fingerprints.
- [tls-client vs a real browser: when TLS is enough](vs-tls-client.md) - When JA3/HTTP2 socket spoofing suffices on JSON and HTML, and where JS forces a full browser.
## Unmaintained tools
- [puppeteer-extra-plugin-stealth: unmaintained since 2024](puppeteer-extra-stealth-unmaintained.md) - No real update since mid-2024; old patches still work but the checklist froze.
- [pyppeteer's own maintainer says to switch to Playwright](pyppeteer-unmaintained-playwright.md) - Its README calls it unmaintained and points to playwright-python; what switching does not fix.
- [selenium-stealth hasn't been updated since December 2021](selenium-stealth-unmaintained.md) - Last commit December 2021; what its property patches still do and what to check today.
- [Splash is unmaintained, and it was never a real browser](splash-unmaintained-qtwebkit.md) - A QtWebKit render service reporting an engine no real browser ships, which no spoof reaches.
@@ -0,0 +1,199 @@
---
title: "Computer-use agents and browser fingerprint detection"
description: "Computer-use agents click by pixel, not DOM, so driver flags are moot for them. Engine fingerprint and action rhythm remain the detectable signals."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 6
---
# Computer-use agents and browser fingerprint detection
A computer-use agent (CUA) does not read the DOM to decide where to act. It takes a
screenshot, sends the image to a vision model, gets back a pixel coordinate, clicks
there, and takes another screenshot. That loop is the whole architecture of OpenAI's
Computer-Using Agent and of Anthropic's computer-use tool, and it changes which
detection signals matter and which stop mattering.
This page is about that shift: why the automation flags people usually worry about are
moot for a coordinate agent, what is still checkable underneath it, and where
invisible_playwright helps and where you still have to do the work yourself.
## Why the driver flags stop mattering
A CUA never triggers the DOM-automation flags sites check for, because its click is a
coordinate delivered through the input pipeline the same way a real click is, not a
script reaching into the page. Most bot-detection advice targets that automation layer
anyway: `navigator.webdriver`, leftover automation globals, DOM mutations that only a
driver produces, an untrusted event dispatched from code rather than from hardware.
Those signals exist because a selector-driven script reaches into the page and touches
elements directly.
A CUA does not do that. It never calls `querySelector`, never sets an element's
value from script, never dispatches a synthetic event at a node it located by selector.
So the whole family of DOM-automation tells is [mostly not the thing that catches
it](navigator-webdriver-explained.md) - not because the agent hides them, but because
it never generates them in the first place.
That is the part people get wrong. They read that agents are hard to detect and assume
the fingerprint is solved. It is not solved. It is bypassed by the input method, and
two other surfaces are completely untouched by that fact.
## What stays checkable: the engine fingerprint
The agent clicks by coordinate, but the click still lands in a browser, and that
browser answers JavaScript. The site's own scripts still ask the engine what it is:
the WebGL renderer string, the canvas hash, the audio context, the installed fonts, the
screen geometry, the codec list. None of that goes through the DOM the agent avoids. It
goes through the ordinary JS surface every page can read, and a stock automation build
running on a server answers those questions like a server.
This is the surface invisible_playwright is built for. It is a Firefox patched at the
C++ level so the engine renders like a real Windows Firefox: the GPU strings, the
canvas and audio hashes, the font set and the screen all report values a real desktop
would report, derived from one seed so they stay consistent with each other. A
detector cross-checking those fields against one another finds agreement instead of the
contradictions a [half-patched or double-patched stack](playwright-stealth-levels.md)
produces.
The two-line launch is the same whether a human or a vision model drives it:
```python
from invisible_playwright import InvisiblePlaywright
# seed=42 makes the whole fingerprint reproducible run to run
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# the screenshot -> click(x, y) -> screenshot loop a CUA runs
png = page.screenshot() # frame you hand to the vision model
x, y = 480, 320 # coordinate the model returns
page.mouse.click(x, y) # lands through the real input pipeline
png = page.screenshot() # next frame
```
`browser` here is a real Playwright `Browser`, so
[`page.screenshot()`](https://playwright.dev/python/docs/api/class-page#page-screenshot)
and [`page.mouse.click()`](https://playwright.dev/python/docs/api/class-mouse#mouse-click)
are the ordinary documented methods - the same ones a coordinate-clicking agent already
calls. There is no special CUA API to adopt. You feed the screenshot to whatever model
you use and feed its coordinate back to `page.mouse.click`.
## What stays checkable: the action rhythm
The second surface the input method does not fix is timing, and it is the one specific
to agents.
A CUA's loop has a shape. Screenshot, then a pause while a model processes the image and
decides, then a click, then another screenshot. That thinking pause is roughly the same
length every step because it is model latency, not human hesitation, and it repeats with
a regularity no person produces. A human pause varies with what is on screen, drifts,
gets distracted, double-checks. A model's pause is a distribution centered on its
inference time.
invisible_playwright gives the pointer a Bezier-curve path between coordinates rather
than a teleport, which removes the crudest motion tell. It does not reshape the
step-to-step rhythm of your agent loop, because that rhythm is produced by your model
and your code, not by the browser. If your loop clicks every 1.9 seconds because that is
how long the model takes, the engine cannot know to vary it. You add the variance:
jitter the delay between steps, and do not click the instant a screenshot returns. This
is [the pause shaped like model latency](ai-browser-agents-stealth.md), and it is
behaviour, which no fingerprint layer reaches.
## What invisible_playwright does not do
Being honest about the boundary is the point, because a coordinate agent makes it easy
to believe more is handled than actually is.
- **It does not change your IP.** The engine can look like a real Windows desktop and
still be sitting on a datacenter address that a site distrusts on sight. A perfect
fingerprint on a known-bad exit still loses. Bring a clean proxy; the engine cannot
supply one.
- **It does not fix per-account quotas or rate limits.** Those are counted server-side
against your account and address, and no browser property touches them.
- **It does not pace your agent.** The step rhythm above is yours to vary. The engine
handles the pointer path, not the schedule your loop runs on.
- **It does not see the DOM for you.** A CUA works by pixels precisely because it does
not read structure. invisible_playwright does not add DOM understanding; it makes the
browser those pixels are rendered in look real.
What it does do is remove the engine fingerprint from the list of things that give you
away, so that TLS, the driver layer and the render surface read as a genuine Firefox.
That is why it passes most fingerprint checks. It is not why a session with a bad IP and
a metronome rhythm passes, because it does not claim to fix those.
## A measurement worth trusting more than a verdict
The useful test for a CUA setup is not "did the suite say human". It is a field-by-field
comparison against a stock browser on the same machine, because the agent's own loop can
introduce timing the browser knows nothing about.
Open a fingerprinting page under invisible_playwright and under a stock Firefox on the
same host, and diff the reports. On the engine surface the two should agree: same GPU
family, a canvas hash that is stable across two reads in the same session (a hash that
changes per call is [a randomiser announcing itself](canvas-fingerprint-noise.md)), a
font list that belongs to the platform the user agent claims. Where they still differ,
after the address, is your candidate. A [software WebGL renderer or a
datacenter-shaped machine](playwright-docker-detection.md) survives every property patch
because it is not the engine's to change, and it is the most common reason a clean-looking
agent still gets a different page. Run it ten times, not once, because this domain is not
deterministic and a single green run is not a pass.
## Conclusion
Vision and coordinate agents move the detection problem, they do not remove it. The
DOM-automation flags that dominate ordinary Playwright advice are moot for them, because
a click delivered by pixel never generates those flags. What remains is the engine
fingerprint the site reads through its own JavaScript, and the machine-regular rhythm of
the screenshot-click loop. invisible_playwright answers the first: it makes the browser
render like a real Windows Firefox, seed-reproducible and self-consistent. The second is
yours - vary the timing - and so is the IP - bring a clean one. Handle all three and the
agent looks like a person on a real machine. Handle only the browser and you have a real
browser clicking like a robot.
## Short answers to the questions that lead here
**Do computer-use agents get detected as bots?** Not usually through `navigator.webdriver`
or DOM automation flags, because a coordinate click never produces them. They get caught
on the engine fingerprint, on the IP, or on the regular timing of the screenshot-click
loop.
**Does invisible_playwright work with OpenAI or Anthropic computer-use?** Yes. It returns
a real Playwright `Browser`, so `page.screenshot()` and `page.mouse.click(x, y)` - the
two calls a coordinate agent needs - work exactly as documented, on a Firefox that
renders like a real Windows desktop.
**If the agent clicks by pixel, is the fingerprint irrelevant?** No. The click method
avoids DOM tells, but the site still reads the engine through JavaScript. GPU, canvas,
audio, fonts and screen are all still checkable, and a stock server build answers them
like a server.
**Will it stop my agent being rate-limited?** No. Quotas and rate limits are counted
server-side against your account and address. No browser property changes them.
**How do I make the timing look human?** Jitter the delay between loop steps and do not
click the instant a screenshot returns. The engine varies the pointer path; the
step-to-step rhythm is produced by your model and your code, so you vary that.
**Does it fix my IP?** No. It makes the browser look real; it does not change the exit.
A real-looking browser on a datacenter address still loses, so bring a clean proxy.
## Sources
- OpenAI's Computer-Using Agent and Anthropic's computer-use tool, both of which drive a
browser through a screenshot to coordinate-click to screenshot loop rather than by DOM
selector.
- This project's own fingerprint gates and the stock-browser comparison method used to
separate an engine tell from a machine tell from a timing tell.
**See also:** [AI browser agents and stealth](ai-browser-agents-stealth.md) for the
agent-specific timing tell in depth, [browser-use and what you can change](browser-use-detection.md)
for a selector-driven agent by contrast, and [why you can be blocked with a clean
fingerprint](why-blocked-with-a-clean-fingerprint.md) for the surfaces past the browser.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The engine makes the
browser real; the pacing and the proxy are still yours to bring.*
+139
View File
@@ -0,0 +1,139 @@
---
title: "Configuration"
description: "Proxy schemes, DNS handling, and timezone auto-derived from egress IP. Every environment variable the wrapper reads, what each does, and when you need it."
parent: "Documentation"
nav_order: 3
---
# Configuration
Configuration covers three independent surfaces: proxy schemes and credentials, how
the browser's timezone is derived from the egress IP, and the environment variables
that change caching, binary selection and download behavior. None of it is required
for a first run - `InvisiblePlaywright()` works with defaults - but each setting below
exists because a specific situation needs it.
## Proxies
```python
proxy = {
"server": "socks5://gate.example.com:1080",
"username": "user",
"password": "pass",
}
with InvisiblePlaywright(proxy=proxy) as browser:
...
```
Schemes supported: `socks5`, `socks4`, `http`, `https`. DNS is routed through the
proxy by default, no local leak - the SOCKS5-authentication and DNS-resolution
details, including the parts most guides get wrong, are in
[Playwright SOCKS5 proxy with authentication](playwright-socks5-proxy-authentication.md).
The endpoint needs an explicit port. `socks5://gate.example.com` with no `:1080` is
refused with a `ValueError` rather than launched unproxied, which is what it used to
do silently. If you are driving `firefox.launch()` yourself instead of using this
class, pass the same dict to `get_default_stealth_prefs(proxy=...)` so the SOCKS
preferences are written.
Around 90% of proxies are public, so their IPs are already known and blocked before
you ever use them. A perfect browser on a known IP still loses. For the clean 10%,
residential IPs that aren't already known, we recommend
[sx.org](https://sx.org/?c=invisible_playwright), who filter for and serve only IPs
that aren't already on those lists.
## Timezone
The browser timezone follows `timezone=`:
```python
# default: timezone is auto-derived from the egress IP (proxy egress if a
# proxy is set, otherwise the host's own public IP)
with InvisiblePlaywright(proxy=proxy) as browser:
...
# explicit IANA zone always wins, the only way to force a specific zone
with InvisiblePlaywright(proxy=proxy, timezone="America/New_York") as browser:
...
```
Timezone is not one value - it is several surfaces that a detector cross-checks
against each other and against your exit IP, which is why
[setting `timezone_id` and still getting flagged for a mismatch](timezone-proxy-mismatch.md)
is common enough to have its own page.
## Environment variables
The engine downloads itself on first use, verifies a sha256 shipped inside
`invisible-core`, and caches it - the size is on the [installation](installation.md)
page and it happens once per engine version. None of these are a required step; each
row is for a specific situation.
| Variable | When you need it |
|---|---|
| `INVISIBLE_PLAYWRIGHT_CACHE_DIR` | Put the cached engine somewhere else - another drive, a shared location, a path your CI already caches |
| `INVPW_BINARY_PATH` | Point at a binary you already have, and skip the download |
| `STEALTHFOX_GITHUB_TOKEN` | A rate-limited or corporate network that refuses anonymous GitHub downloads |
| `INVISIBLE_PLAYWRIGHT_SKEW=allow` | Run a Playwright version outside the tested range anyway |
| `INVPW_CURSOR_ENGINE` | `python` (default), `binary`, or `off` |
| `INVISIBLE_DOWNLOAD_DEADLINE` | Seconds allowed for one engine download, default `1800`. Raise it on a very slow link; `0` removes the bound |
```bash
export INVISIBLE_PLAYWRIGHT_CACHE_DIR=/mnt/big/engines
```
### Why the download has a deadline at all
`requests` timeouts are per socket operation, not per transfer. A connection
that delivers one byte every 59 seconds satisfies a 60-second timeout forever,
so before `invisible-core` 18.13.0 the engine download had no upper limit: it
could sit there as long as whatever was above it allowed. A CI job did exactly
that for 39 minutes and was killed by its own limit; on a laptop the same thing
is a launch that never returns and writes nothing to a log.
The bound is checked between chunks and the refusal names the deadline, how long
it had been running and how many bytes arrived, so a genuinely slow link is
distinguishable from a stalled one. The engine archives are 217 to 238 MB
depending on platform, so the default finishes anything above roughly 140 KB/s.
If your connection is honestly slower than that, raise the number rather than
removing the bound - `0` is there for the case where you are downloading over
something too unusual to put a number on, and it restores the old behaviour of
waiting indefinitely.
## Short answers to the questions that lead here
**What proxy schemes does invisible_playwright support?** `socks5`, `socks4`, `http`
and `https`. DNS resolves through the proxy by default, and an endpoint given
without an explicit port raises a `ValueError` instead of launching unproxied.
**How is the browser's timezone chosen?** By default it is derived from the egress
IP - the proxy's exit if one is set, otherwise the host's own public IP. Pass an
explicit IANA zone such as `timezone="America/New_York"` to override it; an explicit
zone always wins.
**Do I need to set any environment variables to use invisible_playwright?** No. Every
one in the table above addresses a specific situation - moving the cache directory,
pointing at a binary you already have, a network that blocks anonymous downloads -
and the defaults work without touching any of them.
**Why does the engine download have a deadline, and can I remove it?** Because a
per-socket timeout does not bound a slow transfer: a connection delivering one byte
every 59 seconds satisfies a 60-second timeout forever. The default of 1800 seconds
covers any link above roughly 140 KB/s; set `INVISIBLE_DOWNLOAD_DEADLINE=0` to remove
the bound entirely if your connection is genuinely slower than that.
**What happens if I pass a proxy server with no port?** The constructor raises a
`ValueError` rather than launching the browser unproxied. That is a deliberate change
from older behavior, which used to launch silently without the proxy.
**See also:** [Installation](installation.md) for the one-time engine download these
environment variables configure, [Pinning fingerprint fields](pinning.md) for forcing
specific values like GPU or screen size, and
[Playwright SOCKS5 proxy with authentication](playwright-socks5-proxy-authentication.md)
for the full detail behind the proxy schemes above.
## Next
[Pinning fingerprint fields](pinning.md) covers forcing specific values - a GPU
model, a screen size, a hardware concurrency count - while leaving everything else
seed-derived, and what breaks if you pin one field without its correlated neighbours.
+193
View File
@@ -0,0 +1,193 @@
---
title: "crawl4ai stealth mode and custom browser engines"
description: "crawl4ai accepts browser_type firefox but has no executable_path, so you get Playwright's managed build. Where the adapter seam is and what stealth misses."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 3
---
# crawl4ai stealth mode and custom browser engines
crawl4ai cannot launch a custom (patched) browser binary today, because its
`BrowserConfig` has no `executable_path` field, so `browser_type="firefox"` always gets
Playwright's own managed Firefox build. crawl4ai ships two anti-detection features and a
browser abstraction, which makes it look like a patched engine should drop straight in.
It does not, and the reason is that single missing field rather than an architectural one.
This page is what its configuration actually exposes, what its stealth mode reaches,
where the adapter seam is, the workaround that works today, and the part that no
configuration changes.
## What BrowserConfig exposes, and the field that is missing
`BrowserConfig` exposes the browser choice, headless mode, a user data directory, a proxy
and extra arguments, but not the path to a binary. Read from
`crawl4ai/async_configs.py`:
| Field | Default |
|---|---|
| `browser_type` | `"chromium"` |
| `chrome_channel` / `channel` | `"chromium"` |
| `headless` | `True` |
| `user_data_dir` | `None` |
| `proxy_config` | `None` |
| `extra_args` | `None` |
`browser_type` genuinely accepts `"firefox"`, and Firefox is referenced throughout the
project, so this is not a Chromium-only tool at the configuration level.
What is **not** there is `executable_path`. There is no field that says which binary to
launch, so `browser_type="firefox"` gets you Playwright's own managed Firefox build and
nothing else. A patched engine has no supported way in.
`extra_args` does not close the gap either: it passes command-line arguments to a browser
that has already been chosen, not the choice of browser.
## What crawl4ai's stealth mode actually reaches
crawl4ai's stealth mode reaches only page-level JavaScript, and on Firefox it is largely
inert because its evasion modules target Chromium APIs. There are two separate features
here, and it is worth knowing which is which.
**Stealth mode** applies `playwright-stealth`, which is the page-level approach: scripts
injected into the document that redefine properties before the page's own code runs.
crawl4ai's own documentation is straight about the limitation, and it is the same one
that library states itself: **the evasion modules target Chromium APIs and do not support
Firefox or WebKit.**
So on `browser_type="firefox"` the stealth layer is largely inert, which is a genuinely
important thing to know before choosing that combination.
**The undetected browser adapter** is the heavier option, aimed at sites that look at
more than `navigator.webdriver`.
Both operate above the browser.
[The three levels page](playwright-stealth-levels.md) explains what that layer can and
cannot reach; the short version is that everything the machine reports about itself is
untouched by either.
## Where the seam actually is
The extension point exists and it is not `BrowserConfig`. It is on the crawler strategy:
```python
undetected_adapter = UndetectedAdapter()
crawler_strategy = AsyncPlaywrightCrawlerStrategy(
browser_config=browser_config,
browser_adapter=undetected_adapter,
)
```
`browser_adapter` takes an adapter object, and the project ships `PlaywrightAdapter` and
`UndetectedAdapter`. The documentation describes the pattern as allowing switching
between browser implementations, and then gives no guidance on writing your own.
That is where a different engine would belong: an adapter that owns the launch and hands
back a browser, which is exactly the shape
[scrapy-playwright's browser provider takes](integrations/scrapy-playwright.md) and the
reason that integration is clean. Here the seam is present but undocumented, so anything
built on it is building against a private interface.
**The one-field change that would fix it properly** is `executable_path` on
`BrowserConfig`, passed through to `launch()`. That is a small, well-scoped upstream
change, and until it exists there is no supported route.
## The workaround that works today, with its cost
Playwright resolves its managed browsers from a directory, and that directory is
configurable through [`PLAYWRIGHT_BROWSERS_PATH`](https://playwright.dev/docs/browsers#managing-browser-binaries).
Put a build where Playwright expects to find one, and `p.firefox.launch()` uses it, with
no crawl4ai change at all.
Be clear-eyed about what that is:
- It depends on Playwright's internal directory layout, which is version-stamped and not
a public contract.
- It applies process-wide, so everything else in that process gets the substituted
browser too.
- It will break on a Playwright upgrade, silently, by falling back to the managed build.
It works, and it is a workaround rather than an integration. If you use it, pin your
Playwright version and check the engine at runtime rather than assuming.
```python
# after launch, confirm you got the engine you meant to get
ua = await page.evaluate("() => navigator.userAgent")
```
## What no configuration changes
Everything the machine reports, which on a server is a consistent set of answers all
saying the same thing:
- **No GPU**, so WebGL reports a software renderer.
[What those strings mean](webgl-renderer-strings.md).
- **A container font set** under whatever platform you claim.
[Why more fonts is not the fix](headless-fonts-differ.md).
- **No audio device**, and no speech voices.
[The audio values](audiocontext-fingerprinting.md) and
[the voice list](speech-synthesis-voices.md).
- **A screen with no taskbar.**
[The relationships that have to hold](screen-size-headless-tells.md).
- **The TLS handshake**, decided before any page-level layer exists.
[Which nothing in JavaScript can reach](ja3-ja4-tls-fingerprint.md).
If crawl4ai works on your laptop and fails in a container, this list is where to look
first, and no stealth setting in the library addresses any of it.
[The container walkthrough](playwright-docker-detection.md) goes through it in order.
## Conclusion
crawl4ai is closer to supporting a patched engine than most tools its size: it already
abstracts the browser behind an adapter and already accepts Firefox as a browser type.
What it lacks is the one field that says which binary to run.
Until that exists, the honest options are a private adapter, a process-wide directory
substitution with the caveats above, or accepting the managed build and spending the
effort on the machine instead, which is where most container-based failures actually
originate.
## Short answers to the questions that lead here
**Does crawl4ai support a custom browser binary?** Not through `BrowserConfig`. There is
no `executable_path` field.
**Can crawl4ai use Firefox?** Yes, `browser_type="firefox"`, with Playwright's own
managed build.
**Does crawl4ai's stealth mode work with Firefox?** Largely not. It applies
`playwright-stealth`, whose evasion modules target Chromium APIs.
**What is the undetected browser adapter?** A heavier built-in adapter aimed at stronger
detection, passed as `browser_adapter` to the crawler strategy. It still operates above
the browser.
**Why does crawl4ai work locally and fail in Docker?** Because the container answers
differently about the machine, and none of the library's settings change that.
**Is there any way to use a patched engine today?** A process-wide
`PLAYWRIGHT_BROWSERS_PATH` substitution, with the fragility described above, or a custom
adapter written against an undocumented interface.
**See also:** [three ways to make Playwright undetected](playwright-stealth-levels.md),
for what the page level can reach,
[scrapy-playwright](integrations/scrapy-playwright.md), for what a documented provider
seam looks like, and
[Playwright in Docker](playwright-docker-detection.md).
## Sources
- `crawl4ai/async_configs.py`, for the `BrowserConfig` fields listed above, read
2026-07-27.
- crawl4ai's own documentation for stealth mode and the undetected browser adapter,
including its statement that the underlying evasion modules do not support Firefox.
- Playwright's own [browser-management
documentation](https://playwright.dev/docs/browsers#managing-browser-binaries), for
the `PLAYWRIGHT_BROWSERS_PATH` behaviour the workaround depends on.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. We would rather document the missing field than
publish an integration guide for a seam that is not there.*
+151
View File
@@ -0,0 +1,151 @@
---
title: "How CreepJS decides you are lying"
description: "CreepJS asks whether a browser is telling the truth, not just what it reports. Read from its own source: how it detects a lie and why spoofing scores worse."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 2
---
# How CreepJS decides you are lying
Most fingerprinting tests ask what your browser reports. CreepJS mostly asks whether
your browser is *telling the truth*, which is a different question and a much harder
one to pass by spoofing.
Read from the source on 2026-07-27 ([`abrahamjuliot/creepjs`](https://github.com/abrahamjuliot/creepjs),
`src/lies/index.ts` and the module layout) and not from the rendered page, because
the interesting part is the method instead of the numbers it prints.
## The shape of it
The project is organised into modules that map onto surfaces: `canvas`, `webgl`,
`audio`, `fonts`, `screen`, `timezone`, `intl`, `media`, `speech`, `webrtc`,
`navigator`, `window`, `worker`, `css`, `cssmedia`, `svg`, `domrect`, `math`,
`engine`, `features`.
Then there are four that are not surfaces at all, and they are the point:
- **`lies`**, which detects tampering.
- **`trash`**, which collects values that are junk or impossible.
- **`errors`**, which records what threw when it should not have.
- **`resistance`**, which identifies privacy tooling, including Firefox's own
`resistFingerprinting` mode.
A high score is not "your fingerprint is rare". It is "nothing here contradicts
anything else here, and nothing looks tampered with".
## How it finds tampering
Four techniques, all visible in `src/lies/index.ts`.
**A pristine reference.** It creates fresh iframes and reaches into
[`contentWindow`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/contentWindow)
to get a copy of the built-ins that your page-level patches never
touched, because the patch ran in the parent document. Then it compares. This is the
single most effective move against injected stealth scripts, and it is about fifteen
lines of code.
**Stack-trace inspection.** It matches against `/at Function\.toString /` and
`/at Object\.toString/`. When you replace a native function and then patch
[`Function.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/toString)
to hide it, the way your replacement is called leaves a
different frame in the stack than a genuine native call would. The disguise is
detected by how the disguise itself behaves.
**Descriptor and prototype walking.** For each API it takes
[`Object.getOwnPropertyDescriptor(proto, name)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor),
checks whether `descriptor.value` is
unexpectedly `undefined`, pulls the getter out, and compares
[`Object.getPrototypeOf(apiFunction)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf)
against the native prototype. An override moved
from the prototype to the instance, or a getter that is a plain function rather than
a native one, shows up here without any cleverness.
**Blocking the probe is itself recorded.** Among the lie names in the source are
`client blocked phantom iframe` and `client blocked behemoth iframe`. If your
environment prevents CreepJS from creating its reference iframes, that prevention is
written down as a lie.
That last one is the principle worth taking away, and it generalises far beyond this
tool: **suppressing a signal is a signal**. A browser that refuses to answer is not
quieter than one that answers plainly, it is louder, because refusing is rare and
answering is universal.
## Why uniform spoofing scores badly
Consider the two ways people try to pass this.
**Override everything from JavaScript.** Every override is a candidate for all four
techniques above. The more surfaces you patch, the more lie records you generate, and
a page with many detected lies scores worse than one with an unusual but honest
fingerprint. Effort spent hiding actively hurts.
**Turn on maximum privacy protection.** The `resistance` module exists precisely to
identify this. Firefox's `resistFingerprinting` produces a recognisable pattern, and
being identified as a privacy-tool user is its own classification.
[There is a longer page on why that is the wrong tool for automation](resist-fingerprinting.md).
There is a third option that scores well and is much more work: do not lie in
JavaScript at all. If a value is decided below the JavaScript layer, in the engine,
then there is no override to find, no prototype moved, no `toString` to hide, and no
difference between what the page sees and what a fresh iframe sees. The lie detector
finds nothing because nothing lied.
That is not a claim about any particular tool being undetectable. It is a claim about
where the detection pressure lands: on the seam between the patch and the runtime.
Remove the seam and this whole category of check has nothing to bite on. Everything
else, the plausibility of your GPU, your fonts, your timezone against your IP,
remains exactly as hard as it was.
## What one real, unmodified session actually scored
Run directly against a live Playwright-driven Chromium session with no stealth
layer of any kind applied - no injected patches, no engine-level work, nothing
this project or any comparable tool does. CreepJS's own headless module returned
0% headless and 0% stealth, with a 25% "like headless" partial-similarity score
alongside them. Worth stating plainly what that does and does not mean: it says
this one specific, directly-checked session did not trip CreepJS's headless
heuristics that day, not that headless or automation detection in general is
solved, and not that every Playwright launch configuration scores the same way.
The rest of the report - the parts covered throughout this page, the lie
detection, the consistency checks, the machine-level surfaces - is where the
actual work happens regardless of what this one narrow module reports.
## Reading your own report
Two things worth doing when you open it:
1. **Read the lies section before the score.** A number tells you where you landed.
The lie list tells you what to fix, and it names the API.
2. **Compare the same session twice, and two sessions with the same configuration.**
Consistency across a reload and across a fresh launch is what a real browser has.
If your fingerprint moves between reloads, something is adding noise per call
rather than per identity, and that is its own signature.
## Short answers to the questions that lead here
**What does the CreepJS score actually mean?** Not "your fingerprint is rare". It means
nothing here contradicts anything else here, and nothing looks tampered with.
**Why does it detect my stealth plugin?** Four ways, and each is cheap: a pristine copy
of the built-ins from a fresh iframe, stack-trace inspection, descriptor and prototype
walking, and recording a blocked probe as a lie.
**Should I block CreepJS from creating its iframes?** No. Blocking is written down as a
lie, by name, in its source. Suppressing a signal is a signal.
**Why does more patching score worse?** Because every override is another candidate for
those four techniques. A page with many detected lies scores worse than one with an
unusual but honest fingerprint.
**What passes it?** Not lying in JavaScript at all. If the value is decided below the
JavaScript layer there is no override to find and no seam to detect.
**See also:** [what sannysoft checks](sannysoft-explained.md), whose canvas-in-iframe test is the same idea in miniature, [the three levels](playwright-stealth-levels.md), and [AudioContext fingerprinting](audiocontext-fingerprinting.md), where its silent-buffer check is worked through in detail.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright).
CreepJS is a release gate here. The lie names above are quoted from its source and
not paraphrased, because the exact strings are what you will see in a report.*
+144
View File
@@ -0,0 +1,144 @@
---
title: "Why content_frame() returns None for a cross-origin iframe"
description: "content_frame() returns None on a cross-origin iframe, frame.evaluate() throws, frame_locator times out - one shared cause: process isolation, not a permissions bug."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 9
---
# Why content_frame() returns None for a cross-origin iframe
`content_frame()` returns `None` for a cross-origin iframe when Firefox's
site-isolation feature puts that iframe in a separate OS process: the automation
driver's frame tree holds only an empty placeholder for it, so there is no real frame
reference to hand back. It is not a permissions bug, and the same single cause is why
`frame.evaluate()` throws and `frame_locator` times out on the same iframe.
That cluster of symptoms all lands on the same page, all against the same cross-origin
iframe: [`element_handle.content_frame()`](https://playwright.dev/python/docs/api/class-elementhandle)
returns `None`, [`frame.evaluate()`](https://playwright.dev/python/docs/api/class-frame)
throws a permission error naming a cross-origin object, and
[`frame_locator(...).click()`](https://playwright.dev/python/docs/api/class-framelocator)
times out with `force=True` changing nothing. Disabling JavaScript works around it and
defeats the point of automating the page at all.
These read like three unrelated bugs. They are one bug, and it isn't a permissions
problem. If the iframe you are after is same-origin instead, none of this applies and
[scraping it is a short job with `frame_locator`](how-to-scrape-iframe-content-playwright.md).
## What's actually different about that iframe
The common thread is that the iframe is cross-origin from the page embedding it -
the shape a third-party widget almost always has: a consent banner, a payment form, a
support chat, anything served from a different domain than the page around it.
Firefox's site-isolation feature can put a cross-origin iframe in an entirely
separate OS process from the page that embeds it, as a security boundary between
origins. That boundary is exactly right for security and exactly wrong for an
automation driver that assumed it could reach into every frame from one process.
## Why the driver's own frame tracking breaks
The frame tracking breaks because it is built from a single process while the iframe
lives in another. Playwright drives Firefox through
[Juggler, an internal automation protocol](playwright-protocol-drift.md), which keeps
a tree of every frame on the page so `page.frames`, `content_frame()` and friends can
find them. That tree is built and maintained from the parent process.
When the iframe's browsing context lives in a different, isolated process, the
parent-side frame tree registers a placeholder for it instead of the real thing: no
URL, no docShell reference, no execution context that actually wraps the iframe's
global object. Every one of the three failing operations needs exactly the piece
that placeholder doesn't have, which is why fixing one never fixed the others - they
were never three separate problems to fix.
## Why this is easy to misdiagnose the first time
The first fix attempt targeted the wrong layer entirely, and it's worth walking
through why, because the failure mode generalises.
The instinct was to wrap the suspect property read in a try/catch, on the theory that
a security exception was firing and needed handling. It wasn't. The property in
question simply isn't exposed to page-level script at all, so reading it from that
scope returns `undefined` rather than throwing - there was never an exception to
catch, and the code silently did nothing.
A second attempt tried comparing two identifiers to detect the isolated case
directly. Both sides of that comparison turned out to be unreachable from the
context the check ran in, so the comparison was comparing two things that were
always going to be equal (or always going to be absent) regardless of whether the
real bug was present.
Neither fix was tested against a reproduction that failed on the broken binary and
passed on a fixed one - both were committed on the strength of a plausible-sounding
theory. [The general version of that mistake, and the discipline that catches it,](how-to-test-bot-detection.md)
is worth reading before trusting your own first hypothesis on a bug like this one.
## The actual fix, and why it's a single preference
The fix is a single preference forcing the non-isolating strategy, so every
cross-origin iframe loads into the same process as the page around it instead of a
separate one. That is a real trade: the security boundary the isolating strategy adds
is gone, in exchange for an automation driver whose frame tree actually reaches every
frame on the page. For a stealth-automation engine that already assumes a fully
trusted, single-purpose session, that trade is the right one; it would not be for a
general-purpose browser handling untrusted content by default.
Once the site-isolation strategy was identified as the actual variable, confirming it
took one controlled comparison: the same URL, loaded once with the isolating strategy
active and once with it set to keep same-process handling for every origin. Four
frame-tree entries with empty URLs and no reachable content frame in the first case;
five entries with full URLs and a working `content_frame()` in the second. The
strategy setting was the only thing that differed between the two runs.
## What to check in your own setup
```python
frames = page.frames
for f in frames:
print(f.url or "(empty - possibly isolated)", f.name)
```
An entry with an empty URL and no name, sitting where a real iframe should be, is the
shape of this exact problem. Confirm it by toggling Firefox's site-isolation strategy
preference and re-running the same check: if the empty entry gains a real URL, that
preference is the cause, not a permissions or timing issue anywhere in your own code.
## Short answers to the questions that lead here
**Why does `content_frame()` return `None` for an iframe that clearly has content?**
The iframe's browsing context is very likely running in a separate, isolated process,
and the driver's frame tree only has a placeholder for it rather than the real
reference.
**Why does `frame.evaluate()` throw a cross-origin permission error here specifically?**
Same root cause. The evaluation target the driver is trying to reach isn't actually
wired to the real execution context.
**Does `force=True` fix a `frame_locator` timeout on a cross-origin iframe?** No,
because the element genuinely isn't reachable through the frame tree the driver is
using; forcing the click doesn't change what frame tree exists.
**Is this a permissions bug?** No. Nothing was denied in the security sense; the
property being read simply isn't exposed to the scope trying to read it, and the
underlying frame reference the driver needs was never populated in the first place.
**See also:** [why an attached debugger makes automation detectable](debugger-timing-detection.md),
for another case where the automation layer itself was the actual surface; and
[how to test whether your setup is actually working](how-to-test-bot-detection.md),
for the reproduction discipline that caught the two wrong fixes here.
## Sources
- This project's own patch history for the root-cause diagnosis, the two earlier
incorrect fixes and why each one failed to address anything, the single-preference
fix, and the regression test suite that locks the fixed behaviour in.
- Playwright's own API reference for the three calls involved: [`ElementHandle.content_frame`](https://playwright.dev/python/docs/api/class-elementhandle),
[`Frame.evaluate`](https://playwright.dev/python/docs/api/class-frame), and
[`FrameLocator`](https://playwright.dev/python/docs/api/class-framelocator).
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level, on a bug that took two wrong committed fixes before
the actual cause was reproduced.*
+228
View File
@@ -0,0 +1,228 @@
---
title: "CSS fingerprinting: what media queries reveal"
description: "Media queries and CSS system colours fingerprint a machine with no JavaScript, beyond page-level stealth. What they expose, and the two consistency traps."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 9
---
# CSS fingerprinting: what media queries reveal
**CSS fingerprinting identifies a machine using only stylesheet media queries and system
colours, with no JavaScript at all.** Media queries reveal the pointer type, the
operating-system dark-mode setting, display resolution and colour gamut, the screen size,
and accessibility preferences; CSS system colours reveal the operating system itself. Each
is read by loading a different resource per branch, so the server learns the answer from
which request arrives.
Almost everything written about [what a browser fingerprint is](what-is-a-browser-fingerprint.md)
assumes JavaScript. Disable it, block it, patch it, and the discussion is about what a
script can read.
CSS does not need a script. A stylesheet can ask what kind of pointer you have, whether
your system is in dark mode, how many colours your display shows, and how large it is,
and it can report the answer by loading a different background image per branch. No
JavaScript runs, so **no page-level stealth layer is involved at all**.
This page covers what the features expose, the two places where CSS and JavaScript can
disagree about the same machine, the system-colour surface almost nobody knows about,
and what a consistent answer looks like.
## How a stylesheet exfiltrates without a script
**A stylesheet exfiltrates data with no JavaScript at all by loading a different image
per media-query branch, so the browser that requests one image rather than another has
answered the query.** The pattern is a few lines of CSS and has been known for years:
```css
@media (pointer: fine) { body { background-image: url("/p?fine"); } }
@media (pointer: coarse) { body { background-image: url("/p?coarse"); } }
@media (prefers-color-scheme: dark) { body { border-image: url("/c?dark"); } }
```
Only the matching branch loads its image, so the server learns the answer from which
request arrives. Repeat across a dozen features and you have a fingerprint assembled
entirely from network requests.
Two consequences worth being explicit about:
- **Blocking or patching JavaScript does nothing here.** There is no function to
override and no object to inspect.
- **It works on the first paint**, before any script you inject has a chance to run,
which sidesteps the timing problem that
[page-level patches have anyway](navigator-webdriver-explained.md).
Estimates of how much entropy this reaches vary, and the useful number is not the total.
It is that these values are *free* to collect and are rarely part of anyone's checklist.
## The media features that actually carry information
Not every media feature carries useful entropy. The ones that identify a machine fall into
five groups: pointer and hover capabilities, colour scheme, display characteristics,
accessibility preferences, and size.
| Media feature | What it reveals |
|---|---|
| `pointer`, `any-pointer`, `hover`, `any-hover` | Input devices: mouse vs touch, and whether the device has both |
| `prefers-color-scheme` | OS dark-mode setting, close to a coin flip across real users |
| `resolution`, `color-gamut` | Display panel class (`p3` marks a modern, wide-gamut display) |
| `prefers-reduced-motion`, `prefers-contrast`, `forced-colors`, `inverted-colors` | Accessibility preferences; a non-default value is rare and identifying |
| `width`, `height`, `device-width`, `device-height` | Screen and viewport size, and the CSS/JavaScript consistency trap below |
**Pointer and hover.**
[`pointer`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer),
`any-pointer`, `hover`, `any-hover`. A desktop with a
mouse reports `fine` and `hover`. A phone reports `coarse` and `none`. A touchscreen
laptop reports both, through the `any-` variants, which is how a device with two input
methods is distinguished from one with a single method.
**Colour scheme.**
[`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)
is the operating system's dark mode setting,
and it is close to a coin flip across real users, so it is a genuine bit rather than a
constant.
**Display characteristics.** `resolution` and `color-gamut` describe the panel.
`color-gamut: p3` says a modern, better-than-average display; see
[color-gamut as a display fingerprint](color-gamut-hdr-media-query-fingerprint.md) for how
that one media query alone narrows the field.
**Accessibility preferences.** `prefers-reduced-motion`, `prefers-contrast`,
`forced-colors`, `inverted-colors`. Almost everyone leaves these at the default, which
is exactly why a non-default value is informative: it is rare.
**Size.** `width`, `height`, `device-width`, `device-height`, and the interaction with
`resolution`. Which brings us to the trap.
## Trap one: CSS and JavaScript can disagree about the screen
**In Firefox, the size a media query resolves against and the size `screen.width`
reports come from different code inside the browser** - two separate paths to the same
physical fact. Patch only the JavaScript side and the two disagree about the same
machine; this is a mistake specific to spoofing, and it is invisible unless you look
for it directly.
Concretely, spoofing only the JavaScript side produces a browser where:
```js
screen.width // 1920
matchMedia('(device-width: 1920px)').matches // false, the real panel is something else
```
One line of CSS and one line of JavaScript, and they disagree about the machine they are
running on. That is not an unusual value, it is a contradiction, and contradictions are
what the checks in this whole subject are built on.
The same applies to the pointer capabilities: a touchscreen laptop reporting `coarse` to
CSS while the JavaScript side claims a desktop persona is the same class of mismatch.
This project handles both in the browser's own media-feature code, so the CSS device
size comes from the same profile as `screen`, and the pointer capabilities report a
mouse rather than whatever hardware the host happens to have.
### How to check it yourself
```js
console.log(screen.width, screen.height);
console.log(matchMedia(`(device-width: ${screen.width}px)`).matches); // want true
console.log(matchMedia('(pointer: fine)').matches,
matchMedia('(any-pointer: coarse)').matches);
```
If the second line is `false`, something is spoofing one side only.
## Trap two: CSS system colours give away the operating system
**[CSS system colour keywords](https://developer.mozilla.org/en-US/docs/Web/CSS/system-color) -
`ButtonFace`, `ButtonText`, `Canvas`, `CanvasText`, `Highlight`, `HighlightText`,
`Menu`, `Field`, and a few dozen more - resolve to the operating system's own interface
palette, readable with no permission and one function call.** This surface is
genuinely obscure, and it is checked in production:
```js
const d = document.createElement('div');
d.style.color = 'ButtonText';
d.style.backgroundColor = 'ButtonFace';
document.body.appendChild(d);
getComputedStyle(d).color; // an RGB triple from the OS theme
```
Those values are the actual theme colours. On Windows they come from the Win32 palette.
On Linux they resolve through the desktop theme, and the RGB values are different, even
when the user agent says Windows.
So a browser claiming Windows and returning a Linux theme's palette has answered the
platform question twice with two different answers, from a surface most people have
never enumerated. A commercial fingerprinting service hashes exactly this set.
This project pins the full palette to the Windows default so it matches the claimed
platform, with one exception worth knowing: when the persona is a dark-theme user, the
palette is skipped and the dark-mode preference is set instead, because pinning a light
palette onto a dark-mode profile would create the contradiction it exists to prevent.
## What a consistent CSS answer looks like
Working from all of the above:
- **Pointer and hover describe one plausible input device**, and agree between the
`any-` variants and the plain ones.
- **The CSS device size matches `screen`**, exactly.
- **`prefers-color-scheme` matches the system-colour palette.** Dark mode with a light
palette is a contradiction.
- **Accessibility preferences are at their defaults** unless you have a reason, because
non-default values are rare and therefore identifying.
- **`color-gamut` and `resolution` suit the display you claim.**
- **Everything is stable for the session.** A colour scheme that flips mid-session is a
browser nobody has.
## Conclusion
CSS fingerprinting matters not because it is the strongest signal but because it is the
one that operates below every layer people normally work at. There is no script to
patch, so the values have to be right at the source or not at all.
The two traps are the practical takeaway. CSS and JavaScript reach the screen size by
different routes inside the browser, and the system-colour palette is a platform tell
sitting in plain sight, readable with one `getComputedStyle` call.
## Short answers to the questions that lead here
**Can a website fingerprint me with CSS alone?** Yes. Media queries can load different
resources per branch, so the server learns the answer without any script running.
**Does blocking JavaScript stop CSS fingerprinting?** No. That is the point of it.
**What is `prefers-color-scheme` worth to a tracker?** Roughly one bit, and a reliable
one, because real users are split between the two settings.
**Why would CSS and `screen.width` disagree?** Because the browser resolves them through
different code, so spoofing one and not the other leaves them inconsistent.
**Are CSS system colours really used for fingerprinting?** Yes, by hashing the resolved
values of the system keywords. They also reveal the operating system independently of
the user agent.
**Should I set unusual accessibility preferences?** No. Almost everyone is at the
default, so anything else narrows you down rather than hiding you.
**See also:** [screen size and viewport tells](screen-size-headless-tells.md), which is
the JavaScript half of the size question,
[why headless browsers render different fonts](headless-fonts-differ.md), another
platform tell that no script controls, and
[the checklist for being detected on one site](playwright-detected-as-bot.md).
## Sources
- MDN's [reference for the `@media` at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@media)
and the individual media features named above.
- Published work on CSS-based fingerprinting, which is where the load-an-image-per-branch
technique is described.
- This project's own media-feature and system-colour handling, and the reason the palette
is skipped for dark-theme personas.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. The system-colour palette is pinned here because a
commercial detector was hashing it and catching the host operating system through it.*
+200
View File
@@ -0,0 +1,200 @@
---
title: "Why an attached debugger makes automation detectable"
description: "A fingerprinting service reported developer_tools true with no devtools open. The cause was the automation framework's attached debugger, four separate leaks."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 3
---
# Why an attached debugger makes automation detectable
An attached JavaScript debugger makes automation detectable because it measurably
changes how fast the page runs, and that timing difference shows up even when every
property on the page looks normal. **Attaching a debugger, which is how automation
frameworks evaluate code and track execution, puts the JavaScript engine into debug
mode - and debug mode is slower in ways a page can time.**
That is what caught us. A commercial fingerprinting service was reporting
`developer_tools: true` on our sessions. No devtools window was open. Nothing was
inspecting anything. The browser looked, by every property-level check we could run,
completely normal. It was right anyway.
This page is what that means, the four separate leaks it turned out to be, and the one
that mattered most, which had nothing to do with timing at all.
## The mechanism
Playwright drives Firefox through a component that needs to evaluate code in the page,
track promises and manage execution contexts. The natural way to do that is the
engine's own `Debugger` API. [The same frame-tracking machinery has its own separate
failure mode against cross-origin iframes](cross-origin-iframe-unreachable.md), for a
different reason than anything covered here.
Attaching one calls `setIsDebuggee()` on every realm it touches, and that flag is not
cosmetic. It puts the JavaScript engine into debug mode:
- **The optimising JIT is disabled**, so JavaScript runs several times slower.
- A slow path runs **on every native function call**.
- A slow path runs **on every frame exit**.
- A slow path runs **on every exception**.
None of that is visible as a property. There is no `navigator.isBeingDebugged`. But it
is trivially visible as *time*.
Run 50,000 iterations of something and measure. A normal Firefox and a debug-mode
Firefox produce different distributions, not just different totals, and a model trained
on real browsers separates them easily. That is what the service was doing, and
`developer_tools: true` was its conclusion.
**The general point, which is bigger than this bug:** [a browser fingerprint](what-is-a-browser-fingerprint.md)
is not only the set of values a browser reports. It includes how the browser behaves, and performance is a
behaviour. You can spoof every string on the page and still be running measurably
differently from the thing you claim to be - [the same value-versus-output gap](renderer-string-vs-render.md)
that cost us a WebGL renderer flag before it cost us this one.
## Fix one: attach without entering debug mode
The debugger does not actually need debug mode for what an automation driver uses it
for. Evaluating code in a realm and holding references to values work without it; what
needs it is stepping, breakpoints and the hooks that fire on every call.
So the engine gained a flag. When it is set, the realm is never marked as a debuggee:
the JIT stays on, the slow paths stay off, and evaluation still works because that path
never consulted the flag in the first place.
Result: `developer_tools: false`, on every session we measured afterwards.
## Fix two: the stack traces said too much
Two separate leaks, both readable from ordinary JavaScript by anyone who throws an
error and reads [`Error.stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack).
**Frames belonging to the automation layer.** The driver's own code lived at
`chrome://juggler/...`, and when the stack was built those frames were in it. A page
that captures a stack sees frames from a source no ordinary browsing produces. The fix
is to skip frames whose source belongs to the automation layer while the stack string is
built.
**The name of evaluated code.** When the driver evaluated something, the engine labelled
it `debugger eval code`, with an introduction type of `debugger eval`. Both strings are
visible in stacks. They now say `eval code` and `eval`, which is what ordinary
evaluation is called.
Neither of these needs a fingerprinting library. `try { null.f() } catch (e) { e.stack }`
is the whole technique.
## Fix three: attached but invisible
Even with debug mode skipped, the debugger was still being registered in the realm's
internal list of debuggers, which meant `hasDebuggers()` was true.
That state is not readable from JavaScript. It did, however, keep two engine paths alive
that are not gated on debug mode: a notification on every major garbage collection, and
allocation sampling. So a page realm remained distinguishable from one that had never
been debugged, on an axis nobody was looking at yet.
The fix registers the debugger everywhere it is needed for the driver to work and not in
the list that flips that flag. The realm is now indistinguishable from a never-debugged
one.
This is the sort of thing that is easy to dismiss as theoretical. We fixed it because
the previous three had all been theoretical right up until something measured them.
## Fix four, and this is the one that mattered
The others were about how the engine behaved. This one was about something the driver
did to the page, and it was the load-bearing fix.
Every execution context, when created, immediately ran a small helper in **the page's own
realm**, so that serialisation would be fast later. It ran before any of the page's
scripts.
That helper touched `JSON`, `Date.prototype` and `Array.prototype`. In the page's realm.
Before the page existed.
A page that has been automated therefore started with built-in prototypes that had been
touched by something else first, and that is observable. In a controlled experiment,
this was the difference between being blocked and not being blocked by a commercial
protection stack, with everything else held constant.
The fix is unglamorous: build the helper lazily, on first use, which is always after the
page has loaded and always in response to something the client asked for. The page realm
is now untouched until the page's own first script runs.
If you take one thing from this page, take that shape:
> The most expensive leak was not a value the browser reported. It was code that ran in
> the page's world before the page did.
## The related one: every evaluate was a user gesture
While looking at the same file we found that evaluating script was announcing itself
another way. Before running your code, the driver was telling the browser that a user
gesture was in progress, presumably so that gesture-gated APIs would work from
automation.
The side effect is that [`navigator.userActivation`](https://developer.mozilla.org/en-US/docs/Web/API/UserActivation)`.isActive` and `hasBeenActive` became
true as a result of `page.evaluate()`. A page that reads user activation therefore saw a
user gesture that no user made, at a moment no user could have made one. The same theme
runs through [synthetic clicks and the `isTrusted` flag](playwright-clicks-istrusted.md):
automation announcing an interaction that no human performed.
It is now off by default, and available behind a preference for the cases that genuinely
need gesture-gated APIs.
## What to check in your own setup
```js
// 1. does the automation layer appear in stacks?
try { null.f() } catch (e) { console.log(e.stack) }
// 2. is anything claiming a user gesture I did not make?
console.log(navigator.userActivation.isActive, navigator.userActivation.hasBeenActive);
// 3. rough timing sanity, compared against a normal browser on the same machine
const t = performance.now();
for (let i = 0; i < 5e6; i++) Math.sqrt(i);
console.log(performance.now() - t);
```
For the third one the absolute number means nothing. Run it in your automated browser
and in a normal browser on the same machine and compare the ratio. A large gap is the
JIT being off, and no property-level fix addresses it.
## Short answers to the questions that lead here
**Why does a fingerprinting service report devtools when nothing is open?** Because an
attached debugger changes engine behaviour, and that is measurable through timing even
with no window and no property to read.
**Can a page detect that the JIT is disabled?** Not directly, and it does not need to.
It measures how long things take and compares against what a normal browser does.
**Is `Error.stack` really used for detection?** Yes, and it is one of the cheapest
techniques available. It costs one thrown error, and it exposes both the source of every
frame and the label the engine gave to evaluated code.
**Does `page.evaluate()` leave traces?** It can. Ours announced a user gesture, and it
warmed a helper in the page realm before the page loaded. Both were fixed, and both
would have been invisible to any property-level audit.
**Does this affect Chromium-based automation?** The specific fixes are Firefox-side. The
category is not: any driver that attaches to the JavaScript engine or runs code in the
page's world before the page has the same class of problem.
**How would I have found this myself?** By comparing against a stock browser on the same
machine, on timing and on stack contents, rather than on values. Every one of these was
invisible in a property dump.
**See also:** [Function.prototype.toString and the native code check](tostring-native-code-detection.md),
for the property-level half of the same story, and
[three ways to make Playwright undetected](playwright-stealth-levels.md), where the
driver layer is the one this page is about.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level. All four fixes are in this project's engine and
driver, and the fourth one was found by controlled experiment after the first three did
not fully close it.*
+263
View File
@@ -0,0 +1,263 @@
---
title: "Detecting installed fonts in JavaScript by width"
description: "Detect installed fonts in JavaScript with no enumeration API: how the width-comparison probe tells present from absent, and why headless browsers fail it."
parent: "Canvas, WebGL, Fonts and Audio"
grand_parent: "Guides"
nav_order: 11
---
# Detecting installed fonts in JavaScript by width
There is a font-detection technique that needs no font-enumeration API, no
permission, and no privileged surface. It draws a short string in a candidate
font, draws the same string in a known fallback, and compares the two rendered
widths. If they differ, the candidate font is present. If they match to the
pixel, the browser fell back, so the font is absent.
That single comparison is old, cheap, and still in wide use, because it is hard
to disable without breaking real pages. This page is what the width-comparison
probe actually measures, why it is a different thing from hashing [`measureText`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/measureText)
output, what it returns on a bare headless browser, and how a browser that ships
its own font set answers it the same way on Windows, Linux and macOS.
## How the width-comparison probe works
The mechanism is a fallback trick. Set an element to a font stack whose only
entry is a generic family the platform is guaranteed to resolve, measure a test
string, and record that width as the baseline. Then prepend a candidate family
to the same stack and measure again. The browser uses the candidate if it can
resolve it, and falls back to the generic if it cannot. A different width means
the candidate rendered; an identical width means it did not exist.
```javascript
// The classic width-comparison presence probe, no enumeration API involved.
function fontIsPresent(family) {
const probe = "mmmmmmmmmmlli wwww 0123456789";
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
ctx.font = "72px monospace";
const baseline = ctx.measureText(probe).width;
ctx.font = `72px "${family}", monospace`;
const candidate = ctx.measureText(probe).width;
// Present if the candidate changed the width away from the fallback.
return candidate !== baseline;
}
```
The same idea works with a hidden DOM element and [`offsetWidth`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetWidth) instead of a
canvas; the width number comes from the same text-shaping path either way. A
detector then runs this over a list of a few hundred font names and turns the
present/absent bits into a vector. Two facts about that vector are what make it
useful to a detector: it is stable for one machine, and it varies between
machines, because the installed-font set is one of the more distinctive things
about a device.
## Why this is different from hashing measureText
It is easy to lump this in with `measureText` fingerprinting, but the two probe
different things and a browser can answer one well and the other badly.
A `measureText` hash reads the exact sub-pixel width of one string in one font
and treats the fractional part as entropy. It does not care whether a font is
present; it cares that the same font renders to a slightly different width on
two machines because of the rasterizer behind it.
The width-comparison probe on this page throws that precision away. It only
asks a yes-or-no question: did the width move at all. A font that renders one
pixel wider than the fallback is just as "present" as one that renders forty
pixels wider.
That distinction matters for a disguise. Hiding from the hash means making the
fractional width deterministic and detached from the host rasterizer, which is
[what a bounded per-run offset on the text-shaping path does](measuretext-textmetrics-fingerprinting.md).
Hiding from the presence probe means controlling which families resolve at all,
which is a font-set problem, not a metrics problem.
Get the first right and the second wrong and you have a clean width hash sitting
on top of a font list that screams "Linux server". The two have to be solved
together, and this is one reason [headless browsers render a different set of fonts than a desktop](headless-fonts-differ.md).
## What the probe reads on a bare headless browser
Run the probe on stock headless Chrome or Firefox in a container and the result
is not "no fonts". It is a font set that belongs to the base image.
A default Linux container answers "present" for DejaVu, Liberation and a handful
of Noto families, and "absent" for every family a Windows desktop ships: no
Segoe UI, no Calibri, no Cambria, no Consolas. The probe does not need to know
those names to score you. It runs its whole list, gets a vector that matches no
consumer operating system, and that mismatch is the signal.
Claiming Windows in the user agent while the font vector is a Linux base image
is a one-line contradiction, and it is exactly the kind of internal disagreement
that [a browser that inspects consistency rather than values](how-to-test-bot-detection.md)
records as a lie.
The same probe list produces a different vector in each of these three cases:
| Environment | Fonts that resolve (present) | Windows desktop fonts (absent) |
|---|---|---|
| Default Linux container | DejaVu, Liberation, a few Noto families | Segoe UI, Calibri, Cambria, Consolas |
| Real Windows desktop | Segoe UI, Calibri, Cambria, Consolas and the rest of the Windows set | none, they are installed |
| Bundled font set (this project) | the same fixed Windows set on every host | none, shipped inside the binary |
The reverse failure is just as visible. A build that tries to suppress the probe
by forcing every candidate to fall back returns "absent" for everything,
including the generic families a real browser always has. An all-absent vector
is not a real machine either. A suppressed signal is itself a tell, so the goal
is not to answer "no" to everything, it is to answer the way a specific real
desktop would.
## Running the probe against a bundled font set
The approach this project takes is to stop borrowing the host's fonts at all.
The patched Firefox carries a fixed set of real Windows font files inside the
binary and builds the family list from a single manifest, so the same set is
present whether the process runs on a Windows laptop, a Linux server or a macOS
runner. The width-comparison probe sees that set and nothing from the machine
underneath.
Here is the probe run end to end against a reproducible identity. It measures a
list of families, splits them into present and absent, and prints the vector the
detector would score.
```python
from invisible_playwright import InvisiblePlaywright
CANDIDATES = [
"Segoe UI", "Calibri", "Cambria", "Consolas", "Arial", "Tahoma",
"Times New Roman", "Verdana", "Georgia", "Trebuchet MS",
"DejaVu Sans", "Liberation Sans", "Ubuntu", "Noto Sans CJK SC",
]
PROBE_JS = """
(families) => {
const probe = "mmmmmmmmmmlli wwww 0123456789";
const ctx = document.createElement("canvas").getContext("2d");
const widthIn = (stack) => { ctx.font = `72px ${stack}`; return ctx.measureText(probe).width; };
const baseline = widthIn("monospace");
const present = [], absent = [];
for (const f of families) {
(widthIn(`"${f}", monospace`) !== baseline ? present : absent).push(f);
}
return { present, absent };
}
"""
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
result = page.evaluate(PROBE_JS, CANDIDATES)
print("present:", result["present"])
print("absent :", result["absent"])
```
The Windows families resolve and the Linux-only families fall back, on every
host, because the resolution is decided by the bundled manifest and not by
whatever fonts the container happens to have. `browser` here is a real Playwright
`Browser`, so this is ordinary `page.evaluate` against a live page, nothing the
wrapper had to add.
## Why the answer is identical across operating systems
The reason this holds up is that both halves of the probe are host-independent by
construction.
The present/absent half is settled by the manifest. The family list is built
from the same checked-in data on all three platforms, so the set of names that
resolve is a property of the build, not of the OS font directory. There is no
path where the host's DejaVu or the host's system UI font leaks into the list
that content can enumerate.
The width half is where a naive bundle would still leak. If the widths came
straight from the platform rasterizer, the same bundled font would measure a
little differently under DirectWrite on Windows than under FreeType on Linux, and
the fractional widths would sort the machines back into OS buckets even with an
identical font set.
Instead the width for a run gets one bounded sub-pixel offset, applied once to
the last glyph of the run and derived from the session seed, rather than from
the host text engine. It is length-independent, so it does not grow with the
string, and it is deterministic, so the same seed gives the same width every
time. The result is that the width-comparison probe, and the finer width-hash
probe layered on it, both answer from the seed rather than from the operating
system.
You can watch that directly: run the block above with `seed=42` on two different
machines and the present/absent split and the measured widths match. Change the
seed and the widths shift together while the present/absent split stays fixed,
because the font set is the same identity and only the metrics jitter is
per-seed. That is the difference between a font disguise that is [consistent
across platforms](bundled-fonts-cross-platform.md) and one that merely looks
right on the machine you built it on.
## Conclusion
The width-comparison probe is durable precisely because it is simple: a fallback,
two measurements, a subtraction. You cannot answer it by patching a property,
because there is no property, only the rendered width of a string. The only way
to give it a coherent answer is to control the font set it resolves and the
widths it reads, together, and to make both come from the identity rather than
from the host.
That is the test to hold any stealth setup to. Enumerate the presence vector,
confirm it matches a real desktop instead of a base image, then read the widths
twice and confirm they are stable and detached from the OS underneath. A vector
that is all-present, all-absent, or quietly shaped like the server it runs on has
failed, whatever the headline verdict says.
## Short answers to the questions that lead here
**Can JavaScript detect installed fonts without an enumeration API?** Yes. It
draws a test string in a candidate font and in a generic fallback and compares
the two widths; a difference means the font is installed. No permission or
special API is required.
**How does the width comparison actually tell present from absent?** The browser
uses the candidate font if it can resolve it and the fallback if it cannot. The
same string in a resolved font measures a different width than in the fallback,
so a width that moves means present and a width that matches means absent.
**Is this the same as measureText fingerprinting?** No. `measureText`
fingerprinting reads the exact fractional width as entropy. The presence probe
only checks whether the width moved at all. A browser can hide from one and leak
the other, so both have to be handled.
**Why does a headless browser fail this probe?** Because its font set belongs to
the base image, not to the platform it claims. A Linux container answers
"absent" for every Windows desktop font, and that vector matches no real
consumer OS.
**Does hiding fonts by making them all absent work?** No. An all-absent vector is
not a real machine either, and a suppressed signal is its own tell. The aim is to
answer the way a specific real desktop would, not to answer no to everything.
**Why do the widths come out the same on Windows and Linux here?** Because the
font set is built from one manifest on every OS, and the width for a run carries a
single bounded, seed-derived offset instead of the host rasterizer's metrics, so
the numbers track the seed rather than the operating system.
## Sources
- This project's font architecture notes: a bundled Windows font set built from a
single manifest, exposing the same families on all three operating systems, and
a bounded per-run width offset on the text-shaping path that replaces the host
rasterizer's metrics.
- The width-comparison presence technique as it appears in public detection
suites, read as the fallback-and-subtract mechanism described above rather than
from any one implementation.
**See also:** [why a bundled font set stays identical across platforms](bundled-fonts-cross-platform.md),
[how the measureText width hash is handled](measuretext-textmetrics-fingerprinting.md),
and [why headless browsers render a different font set](headless-fonts-differ.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The font set is the
same on every host by construction, which is the only reason this probe answers
the same way whether the process runs on a laptop or a container.*
+199
View File
@@ -0,0 +1,199 @@
---
title: "window.devicePixelRatio: the pref that spoofs it"
description: "Set window.devicePixelRatio in Firefox with the layout.css.devPixelsPerPx string pref, why plausible pref keys do nothing, and the three values it must match."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 22
---
# window.devicePixelRatio: the pref that spoofs it
In Firefox, [`window.devicePixelRatio`](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio) is spoofed by one about:config pref,
`layout.css.devPixelsPerPx`, set as a string such as `"1.25"`. The keys that live in a
`screen` or a `dpr` namespace look right but are never read, so setting one changes
nothing. Getting the value to move is the easy half; keeping it consistent with the two
other places a device pixel ratio shows up is what keeps a session unremarkable.
There is a whole class of Firefox device-pixel-ratio spoofs that share one property:
they set a pref, the code runs without error, and `window.devicePixelRatio` does not
change. The value stays at whatever the machine reports, the spoof is announced nowhere,
and the only way you find out is by reading the property back.
This page is about the one pref that does move it, the reason the plausible-looking keys
do not, and the three values that have to tell the same story once you get it moving.
## Why a dpr spoof can run and change nothing
Firefox reads a fixed set of preferences at startup. A pref name that is not declared in
the build is not an error: you can set it, it lands in the profile, and no code ever asks
for it. It is a note left in a room nobody visits.
Device pixel ratio is the surface where this bites hardest, because the name that
suggests itself is almost never the name the engine reads. People reach for something in a
`screen` or a `dpr` namespace, set it, and move on without reading the value back. We did
a version of this ourselves in an earlier build: the wrapper wrote a dpr value to a key
that Firefox does not read, so it was a silent no-op for every session until we noticed
the property had never actually moved. We removed the dead write and kept only the pref
below. The lesson outlived the bug: a pref you set is not a pref that took effect, and
[the general version of that trap has its own page](firefox-prefs-not-applying.md).
## The pref Firefox actually reads
`window.devicePixelRatio` in Firefox is driven by the native about:config pref
`layout.css.devPixelsPerPx`. It is a string pref, and the value is the ratio written as
text:
```python
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.firefox.launch(firefox_user_prefs={
# a STRING, not a bare float: "1.25", not 1.25
"layout.css.devPixelsPerPx": "1.25",
})
page = browser.new_page()
page.goto("https://example.com")
print(page.evaluate("window.devicePixelRatio")) # 1.25
browser.close()
```
Two things about this pref that catch people out. It is a string, so pass the number as
text; a bare numeric value is a different kind of pref value and the parser will not treat
it the same way. And it is a global scale for the whole browser, not a per-context knob,
which is exactly why it has to be kept consistent with the per-context values Playwright
sets separately. That is the next section.
## The three values that must tell the same story
Setting the pixel ratio is the easy half. The half that gets a session flagged is
consistency, because a device pixel ratio shows up in three places that a detector can
read independently and compare:
1. `window.devicePixelRatio`, driven by the pref above.
2. Playwright's per-context [`device_scale_factor`](https://playwright.dev/python/docs/api/class-browser#browser-new-context), which scales the rendered viewport.
3. The CSS [resolution media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/resolution), for example `matchMedia("(resolution: 1.25dppx)")`,
which the browser answers from its own scaling.
If the pref says 1.25 and the context was created with `device_scale_factor=1.0`, the
number reported by `devicePixelRatio` and the geometry the page actually renders at
disagree. A real display never does that. The media query is the third witness: it has to
resolve to the same ratio the property reports, or a script that reads both has found a
contradiction that no real machine produces.
This is the same failure mode as a user agent claiming one platform on an engine
reporting another. The individual value is plausible; the disagreement is the tell. It is
also why [an impossible screen geometry is a datacenter signal](screen-size-headless-tells.md)
rather than an automation one, and why
[the CSS resolution query is worth reading directly](css-media-query-fingerprinting.md)
instead of trusting the single property.
## Measuring the agreement with a seed
The point of a seed-reproducible browser is that you stop hand-tuning these values and
start reading them back. With `invisible_playwright` the pixel ratio, the context scale
factor and the media-query answer are all derived from one seed and kept in agreement,
so the useful thing to write is not a setter but a check that the three witnesses match:
```python
from invisible_playwright import InvisiblePlaywright
CHECK = r"""
() => {
const dpr = window.devicePixelRatio;
// does the CSS resolution query agree with the property?
const mq = matchMedia(`(resolution: ${dpr}dppx)`).matches;
return {
devicePixelRatio: dpr,
resolutionQueryAgrees: mq,
screen: `${screen.width}x${screen.height}`,
// physical pixels implied by the scale
physical: `${Math.round(screen.width * dpr)}x${Math.round(screen.height * dpr)}`,
};
}
"""
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
report = page.evaluate(CHECK)
print(report)
assert report["resolutionQueryAgrees"], "dpr and the resolution media query disagree"
```
Run it twice with the same seed and every field comes back identical, which is what makes
a failure reproducible: if a page reacts to the pixel ratio, you can replay the exact same
ratio rather than hoping the next random draw lands on it. Run it against a stock browser
on the same machine and diff the report field by field; anything that differs other than
the address is a candidate, and `resolutionQueryAgrees` being `false` on either side is a
straight fail, not a score to weigh.
## What a mismatch looks like from the outside
It helps to picture what a script sees when the three values are not aligned, because it
explains why "just set devicePixelRatio to a normal number" is not enough.
A common real-display pairing is a 1920x1080 screen at a device pixel ratio of 1.0, or a
scaled laptop panel at 1.25 or 1.5. A detector does not check whether your number is one
of those. It checks whether the number, the rendered geometry and the media query point
at the same display. A browser reporting 2.0 while rendering at 1.0 scale, or answering
the resolution query as if it were 1.0 while `devicePixelRatio` says 2.0, has described a
screen that cannot exist. That is a positive signal of tampering, and it is worse than
reporting a boring, honest 1.0, because an inconsistency is information a plain value is
not. The whole reason to read the value back after setting it is to be sure you produced a
real display and not an impossible one.
## Conclusion
Device pixel ratio is a small field with a large blast radius. The pref that moves it in
Firefox is `layout.css.devPixelsPerPx`, set as a string; the plausible-sounding keys in
other namespaces are notes in an empty room. Getting the value to change is the easy part.
The part that keeps a session unremarkable is making the property, the context scale
factor and the CSS resolution media query agree, and then reading all three back to prove
they do, against a stock browser, more than once.
## Short answers to the questions that lead here
**How do I set window.devicePixelRatio in Firefox?** Set the about:config string pref
`layout.css.devPixelsPerPx` to the ratio as text, for example `"1.25"`. It is the only
pref that actually drives the property.
**I set a dpr pref and nothing changed. Why?** Almost certainly you set a pref name the
engine does not read. A pref that is not declared in the build is accepted silently and
never consulted. Read `window.devicePixelRatio` back to confirm it moved.
**Does device_scale_factor set devicePixelRatio?** It scales the rendered viewport for a
context, and it must match the pref, but it is a separate value. If they disagree the
browser reports a display that cannot exist.
**What device pixel ratio should I use?** One that a real display has, like 1.0, 1.25 or
1.5, and the same value in all three places. The specific number matters less than the
three witnesses agreeing.
**Can a site detect a spoofed dpr?** Not from a plausible value on its own. It detects the
contradiction when the property, the render geometry and the resolution media query point
at different displays.
**Why does the ratio have to be a string?** `layout.css.devPixelsPerPx` is a string pref;
pass the number as text, `"1.25"`, not as a bare float.
## Sources
- [MDN: `Window.devicePixelRatio`](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio) -
the ratio of physical pixels to CSS pixels that the property reports.
- [MDN: the `resolution` media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/resolution) -
the `dppx` unit used in the media-query check above.
- [Playwright: `device_scale_factor` on `browser.new_context`](https://playwright.dev/python/docs/api/class-browser#browser-new-context) -
the per-context knob that must agree with the pref.
- Firefox's `layout.css.devPixelsPerPx` pref itself, and the dead dpr write once shipped
here, read from the browser's own behaviour rather than from a rendered report.
**See also:** [why a pref you set can quietly do nothing](firefox-prefs-not-applying.md),
[what an impossible screen geometry gives away](screen-size-headless-tells.md), and
[reading the CSS resolution query directly](css-media-query-fingerprinting.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The dead dpr write in this
page is one we shipped ourselves, and only caught by reading the value back.*
+232
View File
@@ -0,0 +1,232 @@
---
title: "Anti-detect browser or Playwright stealth: which you need"
description: "Deciding between a paid anti-detect browser and stock Playwright on a patched Firefox build: what they share, what the paid GUI adds, and how to script it."
parent: "Comparisons"
nav_order: 33
---
# Anti-detect browser or Playwright stealth: which you need
The honest version of this question is not "which one wins". It is "which
layers do I actually need, and which am I paying for twice". A commercial
anti-detect browser and a patched-engine library overlap on exactly one layer
and differ on the rest, so the answer depends entirely on which layer your
real problem lives in.
This page names the layers, shows where the two approaches meet and where they
part, and gives you the runnable version of the engine layer so you can decide
by trying rather than by reading marketing.
## What you are actually comparing
A commercial anti-detect browser is usually three things sold as one product:
- a **patched browser engine** that reports a consistent, human-looking
fingerprint,
- a **profile and identity manager** that stores many separate personas and
keeps them apart,
- and **proxy wiring plus IP reputation handling**, so each persona leaves
from its own network exit.
All three sit behind a paid GUI, and the whole thing is built for a person
clicking through many accounts by hand.
Stock Playwright driving an open patched Firefox build gives you the first of
those three, scriptably, in Python. You get the same engine-level fingerprint
spoofing. What you do not get for free is the profile manager and the proxy or
reputation layer - the library deliberately leaves those to you, because in
code you usually already have your own way of storing state and choosing an
exit.
So the real question is not "GUI or library". It is: **is your bottleneck the
engine, or is it the network and the identities?** If it is the engine, the two
approaches are equivalent and one of them is free and scriptable. If it is the
network, the engine choice will not move the needle at all.
## The layer they share: a patched engine
This is the part that overlaps, and it is worth being precise about what
"patched engine" buys you, because it is the same thing in both cases.
A real browser reports hundreds of correlated values: the GPU string and the
pixels it actually draws, the audio device, the installed fonts, the screen
geometry, the codecs, the TLS handshake, and the driver layer that automation
frameworks usually announce themselves through - the best-known example being
[`navigator.webdriver`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver),
a specified boolean a real user's browser never sets. A patched engine makes those
read as a genuine Firefox driven by a person, and - this is the part a page
script cannot do - keeps them **consistent with each other**, because most
detection is a cross-check between two values that should agree rather than a
lookup of one unusual value. See
[what a browser fingerprint is made of](what-is-a-browser-fingerprint.md) for
the surfaces involved.
This is also why the engine layer beats the stealth-plugin layer, in a GUI
product or a library alike. A JavaScript patch applied to a page runs after the
browser has already answered the network and driver questions, and stacking two
spoofers produces a contradiction neither produces alone -
[picking one stealth layer](playwright-stealth-levels.md) is the whole game.
The engine layer answers those questions before any page loads, which is why
this project patches Firefox at the C++ level instead of injecting scripts. The
same reasoning shows up when you compare
[a patched Firefox against a patched Chromium](firefox-vs-chromium-antidetect.md)
or against [another Firefox-based build](vs-camoufox.md): the durable difference
is always where the patch lives, not the brand on the box.
## The layers the paid product adds: proxy and identity management
Here is where the paid GUI earns its money, and where the library asks you to
bring your own.
A commercial anti-detect browser stores dozens or hundreds of profiles, assigns
each a proxy, and tries to keep the exit IPs clean and separated so two
personas never share a fingerprint-plus-network story. For a human running many
accounts by hand, that management surface is the product, and rebuilding it in
code is real work.
A library hands you the engine and stops there. You supply the proxy per
session, you decide how identities are stored and rotated, and you own the IP
quality. That is a feature when you are automating: you plug the exit into your
own pipeline instead of clicking through a vendor's UI. It is a cost when what
you actually wanted was the vendor's managed clean IPs, because a patched engine
does not include any.
The dividing line is clean: **the engine makes you look real; the proxy and
identity layer decides whether "real" is enough.** The library gives you the
first outright and leaves the second as an explicit input.
## Doing it in code: the two-line version
If your bottleneck is the engine, this is the whole switch. Any existing
Playwright script becomes a stealthed one by changing how the browser launches;
nothing after that line changes, because the object you get back is a real
Playwright [`Browser`](https://playwright.dev/python/docs/api/class-browser).
```python
from invisible_playwright import InvisiblePlaywright
# seed=42 makes the identity reproducible: same GPU, canvas, audio,
# fonts and screen on every run, so a failing run can be replayed exactly.
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
```
You supply the proxy - the identity/network layer the paid product would manage
for you - as a plain dict. This is the part the library leaves in your hands on
purpose:
```python
from invisible_playwright import InvisiblePlaywright
proxy = {
"server": "socks5://gate.example.com:1080",
"username": "user",
"password": "pass",
}
# timezone defaults to auto, derived from the proxy's egress IP, so the
# browser's zone matches where the network says you are.
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com")
page.click("#submit") # pointer arcs to the target on a Bezier curve
```
The async API is identical in shape (`from invisible_playwright.async_api
import InvisiblePlaywright`, then `await page.goto(...)`), and every standard
Playwright method works unchanged because there is no wrapped subset to learn.
Install is the ordinary way, and the engine downloads itself on first use:
```bash
pip install invisible-playwright
```
That is the engine layer, in full, scriptable. What it does not print is a
managed clean IP - you passed that in yourself.
## The honest caveat: the engine will not fix your IP
This is the sentence that decides most buy-versus-code questions, so it gets its
own section.
invisible_playwright is designed to look like a real browser driven by a real
person, and that is precisely why it clears most detection: the fingerprint,
the TLS handshake and the driver layer read as a genuine Firefox. It does not,
on its own, fix **IP reputation, per-account quotas, rate limits, or the timing
and behaviour of the session**. Those are yours to supply - a clean proxy,
human pacing, sensible request velocity.
A perfect browser on a datacenter IP, or on a residential IP a thousand other
people are using this minute, still loses, and no engine choice changes that.
If your manual visit from the same machine and network also gets the wrong
page, the problem was never the browser -
[why a clean fingerprint still gets blocked](why-blocked-with-a-clean-fingerprint.md)
is the whole story. This is the same layer a paid product's proxy management is
selling, and it is the one honest reason to reach for the GUI: if IP quality is
your real bottleneck, the engine will not fix it, and you should be buying
network reputation, not a browser.
## Conclusion
Buy the GUI when you are a person managing many accounts by hand and you want
the profile store and managed clean exits handled for you. Use the library when
you want programmatic control and you already have, or can build, your own
identity and proxy plumbing - you get the same patched engine, in Python, for
free, and you keep the network layer under your own pipeline.
The overlap is the engine. The paid extra is the network and identity
management the library deliberately leaves to you. Decide by naming which of
those two is actually blocking you today, and the answer stops being a matter of
taste.
## Short answers to the questions that lead here
**Do I need an anti-detect browser at all?** Only for the engine layer, and a
patched Firefox build gives you that scriptably. If you need managed proxies and
a many-account GUI, the paid product bundles those on top.
**Is stock Playwright enough by itself?** For the fingerprint, only with a
patched engine under it - plain Playwright announces itself at the driver and
network layers. For IP reputation and behaviour, no tool is enough; you supply
those.
**Will a patched engine fix my blocks?** It fixes fingerprint, TLS and driver
tells, which is most detection. It does not fix a bad IP, a blown quota, or
robotic timing.
**What does the paid product do that the library does not?** It manages
profiles at scale and wires up proxies with some IP reputation handling behind a
GUI. The library leaves proxy and identity choice to your code on purpose.
**Can I get reproducible identities in code?** Yes - pass `seed=42` and every
fingerprint field comes back identical run after run, which is what makes a
failing run replayable.
**If IP quality is my problem, does any of this help?** No. The engine choice is
orthogonal to network reputation. Buy or rent clean exits; the browser layer
cannot substitute for them.
## Sources
- This project's [Quickstart](quickstart.md) and [Configuration](configuration.md)
pages, for the real launch API, proxy dict and timezone behaviour shown above.
- The troubleshooting order in
[Playwright detected as a bot on one site](playwright-detected-as-bot.md),
which ranks engine tells above IP as the more common and cheaper fix, and IP
reputation as the last and most expensive suspect.
- [MDN: `Navigator.webdriver`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver)
and [Playwright's `Browser` class reference](https://playwright.dev/python/docs/api/class-browser),
for the driver-layer property and the object the launch call above returns.
**See also:** [what a browser fingerprint is made of](what-is-a-browser-fingerprint.md),
[choosing a single stealth layer](playwright-stealth-levels.md), and
[why a clean fingerprint can still be blocked](why-blocked-with-a-clean-fingerprint.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The engine layer
is the part I can hand you; the clean IP is the part you still have to bring.*
@@ -0,0 +1,213 @@
---
title: "Do websites know you are using a script?"
description: "How sites detect scripts driving the browser: navigator.webdriver, CDP, BiDi artifacts, synthetic events and timing tells. What hides automation-layer reveals."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 13
---
# Do websites know you are using a script?
Often, yes, and usually not for the reason people assume. The fingerprint gets most
of the attention, but a site can tell a script is driving the browser through a
separate set of tells that have nothing to do with the GPU, the fonts or the screen.
These are automation-layer tells, and they answer a narrower question than "who are
you": they answer "is a program at the wheel".
The honest version of the answer is that these tells are fixable, and that fixing them
does not make you invisible. It removes the announcement that a script is present. It
does not remove a datacenter IP, a per-account quota, or the fact that you filled a
form in eighty milliseconds. This page covers the announcement, and is clear about
where the announcement ends.
## The four tells that say "a script is here"
None of these depend on your fingerprint. A browser with a flawless machine identity
still trips every one of them if the automation layer is careless.
- **`navigator.webdriver`.** A boolean the automation standard requires the browser to
set to `true` when a driver is attached. It is the single most checked automation
flag on the web, it is one line to read, and [setting it to `false` is not the fix a
real browser reports `undefined`](navigator-webdriver-explained.md).
- **CDP or BiDi artifacts.** The remote control protocols that most drivers speak leave
observable traces: extra objects on the page, timing side effects, a debugger that is
attached. A page can probe for the protocol itself rather than for any property it
sets, which is [why CDP and BiDi have their own detection surface](bidi-vs-cdp-detection.md).
- **Synthetic events with `isTrusted` false.** Every DOM event carries an `isTrusted`
flag. The browser sets it to `true` for events it generated from real hardware input
and `false` for events created in JavaScript. A driver that clicks by dispatching a
synthetic event produces `isTrusted: false`, and [that flag cannot be forged from
page script](playwright-clicks-istrusted.md).
- **Unnaturally regular timing.** Keystrokes at a perfectly uniform interval, a click
the same number of milliseconds after every load, requests on a fixed period. This
one is different from the other three: it is not something the browser leaks, it is
something your code produces.
The first three are properties of the automation plumbing. The fourth is a property of
how you drive. That distinction is the whole point of this page.
## Why invisible_playwright does not expose the first three
invisible_playwright is a Firefox patched at the C++ level, driven by stock Playwright
over a patched protocol. The design goal is that the browser looks like a real Firefox
driven by a real person, and the automation layer is where "driven by a real person"
is won or lost.
The control channel does not present the driver tells that a normal automation setup
exposes: `navigator.webdriver` reads the way a clean browser reads, and the protocol
the wrapper speaks to the engine is not the one the common protocol probes are looking
for. More importantly, input is not synthesized in page script. Clicks and keystrokes
are routed through the browser's real input pipeline, so the events a page sees are
generated by the engine the same way a physical mouse or keyboard would generate them.
That means `isTrusted` is genuinely `true`, because the event genuinely came through
the trusted path, not because a flag was patched.
Switching from plain Playwright to this is two lines, and every Playwright method works
unchanged afterwards:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
page.fill("#name", "Ada Lovelace") # keystrokes go through the real input path
page.click("#submit") # a genuinely trusted click, isTrusted true
```
The `browser` object is a real Playwright `Browser`, so there is no reduced API to
learn. The `seed=42` argument makes the machine identity reproducible, which matters
for debugging: the same seed gives the same browser every run, so a failing run can be
replayed instead of guessed at.
## The tell you still own: timing and behaviour
Here is the caveat, stated plainly. Removing the driver tells hides that a script is
present. It does nothing about the fourth tell, because the fourth tell is yours.
A trusted click that lands at the exact same offset after every page load is still a
robot. A form filled faster than a human can read it is still a robot. A request loop
on a metronome is still a robot. Some sites do not fingerprint the browser at all, they
watch the session, and against those sites the quality of your pacing is the entire
game. This is especially true for [AI agents, whose pauses can be shaped like model
latency rather than human thought](ai-browser-agents-stealth.md).
You control this, which is good news, because it means the fix is in your code rather
than in the engine. Vary the intervals. Do not act faster than a person could. Let the
page settle before the next action. The engine gives you trusted events and human-like
mouse arcs by default; the rhythm of when you fire them is on you.
```python
import random
import time
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
for field, value in [("#first", "Ada"), ("#last", "Lovelace")]:
page.click(field)
page.type(field, value, delay=random.randint(80, 220)) # per-keystroke jitter
time.sleep(random.uniform(0.4, 1.1)) # think between fields
page.click("#submit")
```
## What this does not fix, so you supply it
The driver layer is one of several independent things a site checks, and being clean on
one says nothing about the others. invisible_playwright reads as a genuine Firefox at
the fingerprint, TLS and driver layers, which is why it passes most detection checks.
It does not, on its own, address:
- **IP reputation.** A perfect browser on a known datacenter or already-blocked address
still loses. You supply a clean exit.
- **Per-account quotas and rate limits.** These are counted server-side against your
account or address, and no browser property changes the count.
- **Behaviour and timing**, covered above, which is yours to shape.
- **The country and timezone agreeing with the exit.** The engine auto-derives the
timezone from the egress IP so these do not drift apart, but the exit itself is a
choice you make.
The rule from the rest of these notes applies here too: a suppressed signal is itself a
signal. Hiding that a script is present is worth doing precisely because it is not the
same as hiding everything, and treating it as a complete solution is how a clean driver
layer ends up flagged for a metronomic click.
## How to confirm it on your own setup
Do not take a vendor's word for any of this, including ours. Open a page that reads
these values in both invisible_playwright and a stock browser on the same machine, and
compare the fields. Read `navigator.webdriver`. Attach a listener and read
`event.isTrusted` on a real click versus a scripted one. The [method for testing this without fooling yourself with
a green verdict is its own page](how-to-test-bot-detection.md), and the short version is:
assert the signal you expect is present, do not just confirm a bad one is absent.
```python
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
print("webdriver:", page.evaluate("() => navigator.webdriver"))
trusted = page.evaluate("""() => new Promise(resolve => {
document.addEventListener('click', e => resolve(e.isTrusted), { once: true });
})""")
page.click("body")
print("isTrusted:", trusted)
```
Run it more than once. This domain is not deterministic, and a single green run is not
a pass.
## Conclusion
Websites can tell a script is driving a browser, and they do it mostly through the
automation layer rather than the fingerprint: `navigator.webdriver`, the control
protocol's artifacts, and untrusted synthetic events. invisible_playwright is built so
those three do not announce themselves, because its input goes through the real pipeline
and its protocol does not expose the driver tells. That is genuinely useful and it is
genuinely bounded. The fourth tell, timing, is not the engine's to fix and not something
any browser patch can hide. Get the plumbing clean with the tool, get the rhythm human
with your code, and put both behind an exit that does not give you away on its own.
## Short answers to the questions that lead here
**Can a website tell I am using a script?** Often yes, through automation-layer tells
like `navigator.webdriver`, control-protocol artifacts and untrusted synthetic events,
which are independent of your fingerprint.
**Does hiding navigator.webdriver make me undetectable?** No. It removes one specific
announcement. Timing, IP reputation and rate limits are separate and remain yours to
handle.
**What is isTrusted and why does it matter?** It is a per-event flag the browser sets
`true` only for events from real input. Events synthesized in page script come back
`false`, which flags automation. Input through the real pipeline is trusted for real.
**Will invisible_playwright pass every bot check?** It reads as a genuine Firefox at the
fingerprint, TLS and driver layers, which is why it passes most. It does not fix your IP,
your quotas, or superhuman pacing.
**How do I make my timing look human?** Vary intervals, add per-keystroke jitter, pause
between actions, and never act faster than a person could read the page.
**Is running a script against a site illegal?** That is a question about a site's terms
and your jurisdiction, not about detection. This page is about how detection works, not
about permission to automate.
## Sources
- The [WebDriver specification](https://www.w3.org/TR/webdriver2/#interface) for the
`navigator.webdriver` requirement, the [WebDriver BiDi specification](https://www.w3.org/TR/webdriver-bidi/)
for the remote-protocol surface, and the [DOM standard](https://dom.spec.whatwg.org/#dom-event-istrusted)
for the `isTrusted` event flag, each read from its own text rather than from a summary.
- This project's own input path and protocol behaviour, and its release gates, from which
the trusted-event and driver-tell claims above are measured rather than asserted.
**See also:** [navigator.webdriver, explained](navigator-webdriver-explained.md) for the
one flag every site reads, [why isTrusted separates a real click from a scripted one](playwright-clicks-istrusted.md),
and [testing detection without fooling yourself with a verdict](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. It hides that a script is
present; the pacing is still yours to get right.*
+18
View File
@@ -0,0 +1,18 @@
---
title: "Documentation"
description: "How to install, configure and use invisible_playwright: install and fetch the engine, the two-line switch from plain Playwright, proxy and timezone configuration, pinning specific fields, and the CLI."
has_children: true
nav_order: 2
---
# Documentation
The product itself, not the browser it's built on. [Installation](installation.md)
gets the wrapper and the engine on disk, [Quickstart](quickstart.md) is the two-line
switch from plain Playwright, [Configuration](configuration.md) covers proxies,
timezone and environment variables, [Pinning fingerprint fields](pinning.md) covers
forcing specific values while leaving the rest seed-derived, and the
[CLI reference](cli-reference.md) covers the command line.
If you're here to understand *why* a particular signal matters rather than how to
configure this package, that's [Guides](guides.md) instead.
+255
View File
@@ -0,0 +1,255 @@
---
title: "Does a proxy leak DNS? DoH and DNS leaks explained"
description: "How a SOCKS5 proxy can leak DNS when the host resolves names locally, where DNS-over-HTTPS fits, and how to verify that names exit where the connection does."
parent: "Network, Proxy and WebRTC"
grand_parent: "Guides"
nav_order: 21
---
# Does a proxy leak DNS? DoH and DNS leaks explained
A proxy moves your connection to a different exit. It does not automatically move the
step that happens before the connection: turning `example.com` into an IP address. If
that lookup is done by your own machine while the connection leaves through the proxy,
you have a browser whose traffic exits in one country and whose DNS queries exit from
your real network. That split is a DNS leak, and it is one of the most common ways a
proxied session still tells a consistent story about where you actually are.
This page explains where name resolution happens, the difference between remote and
local resolution over SOCKS5, where DNS-over-HTTPS fits, how to check which one you are
doing, and the one thing fixing the leak does not fix.
## Where DNS resolution actually happens
DNS resolution happens in one of two places: on your own host, using whatever resolver
your operating system is configured to use, or at the proxy exit, where the proxy does
the lookup on your behalf. Every connection to a hostname is really two steps: first a
name is resolved to an address, then a socket is opened to that address. People think of
a proxy as covering "the connection", but there are two connections in that sentence, and
a proxy does not necessarily cover both.
In detail, the resolver step can run in one of two places:
- **On your host**, using whatever DNS server your operating system is configured to
use. That is usually your ISP's resolver, or one handed to you by your local network.
- **At the proxy exit**, where the proxy itself does the lookup on your behalf and only
the connection details come back to you.
When the host resolves, the lookup packets leave from your real network before the proxy
is ever involved. A passive observer on your network, and the resolver you queried, both
see that you asked for `example.com` at a given second. Moments later the destination
site sees a connection arrive from the proxy's country. Correlating those two is not
hard, and it undoes the reason you added the proxy.
## Remote vs local resolution over SOCKS5
SOCKS5, defined in [RFC 1928](https://datatracker.ietf.org/doc/html/rfc1928), is the
scheme where this actually has a choice, which is why it comes up here and not with plain
HTTP proxying. The protocol lets a client send the proxy either an **address** it has
already resolved, or a **hostname** for the proxy to resolve itself.
- **Local (host-side) resolution.** The client resolves `example.com` to an IP using the
host's resolver, then tells the proxy "connect to this IP". The lookup left your
network. This is the leak.
- **Remote (proxy-side) resolution.** The client tells the proxy "connect to this
hostname", and the proxy resolves it at the exit. The lookup and the connection now
leave from the same place.
The trap is that the leaking version is often the default in naive setups. A lot of
tooling resolves the hostname first out of habit and only then hands an address to the
proxy, so the connection is proxied and the DNS is not. Nothing errors. The page loads.
The exit IP looks right in a quick check. The lookup quietly went out your front door.
This is the same class of silent-default problem as
[SOCKS5 authentication that falls back to an unproxied connection](playwright-socks5-proxy-authentication.md)
instead of failing loudly. The difference between the two schemes, and why SOCKS5 is the
one that carries hostnames at all, is covered in
[SOCKS5 vs HTTP proxy for a browser](socks5-vs-http-proxy-browser.md).
invisible_playwright resolves DNS through the proxy by default, so names and connections
exit from the same place. There is no separate switch to remember: pass a SOCKS5 proxy
and the hostname goes to the exit, not to your local resolver.
## Where DNS-over-HTTPS fits
DNS-over-HTTPS (DoH), standardized in
[RFC 8484](https://datatracker.ietf.org/doc/html/rfc8484), encrypts the resolver query
and sends it over HTTPS to a chosen resolver. It is a related but different fix from
proxy-side resolution, and the two solve different problems.
Its purpose is confidentiality: your local network and your ISP can no longer read which
hostnames you are looking up, because the query looks like ordinary HTTPS traffic to some
server.
What DoH does **not** do on its own is change *where* the query exits. If the browser's
DoH request itself goes out your real network rather than through the proxy, the encrypted
lookup still originates from your real IP. The resolver you picked now knows the name, and
a determined observer still sees a lookup-shaped request leaving your network at the same
moment a proxied connection opens elsewhere. Encryption hides the *content* of the leak,
not the *fact* of it.
So DoH and proxy-side resolution answer different questions:
- **Proxy-side resolution** decides *where the lookup exits*. It closes the geographic
split that this whole page is about.
- **DoH** decides *whether the lookup is readable in transit*. It is about privacy from
the network path, not about exit location.
For a proxied automation session, the property you want is that the name resolves at the
exit. When resolution happens at the proxy, the exit's own resolver handles the name, and
the "which resolver, encrypted or not" question moves to the exit's side of the world,
where it belongs. Firefox exposes DoH through standard `network.trr.*` about:config
preferences if you want the encrypted-in-transit property on top, but it is not a
substitute for resolving at the exit.
## Launch invisible_playwright and resolve names at the exit
The whole point of the product here is that the correct behaviour is the default. You pass
a SOCKS5 proxy the ordinary way and the hostname is resolved at the exit, alongside the
connection.
```python
from invisible_playwright import InvisiblePlaywright
proxy = {
"server": "socks5://gate.example.com:1080",
"username": "user",
"password": "pass",
}
# seed=42 makes the whole identity reproducible run to run
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
```
The `browser` object is a real Playwright `Browser`, so every method you already use works
unchanged. The only thing that differs from stock Playwright here is that the name in
`page.goto(...)` is resolved through the proxy rather than by your host, so the DNS query
and the HTTP connection both leave from `gate.example.com`'s exit and not from your
network. Async is the same, from `invisible_playwright.async_api`.
If you drive `firefox.launch()` yourself instead of using this class, the same proxy dict
has to reach the launch through `get_default_stealth_prefs(proxy=...)` so the SOCKS
preferences that route DNS are actually written. Skipping that is how a hand-rolled setup
ends up proxying the connection and leaking the lookup.
## How to verify names exit where the traffic does
Do not assume. The failure mode of a DNS leak is that everything looks fine, so the check
has to be positive: confirm the lookup exit, do not just confirm the absence of an error.
A minimal, honest check has two halves that must agree:
```bash
# 1. What does the world see your CONNECTION exit as?
# Run this THROUGH the browser session, not with a bare curl on the host,
# or you have measured the path you do not use.
```
Inside the session, read the exit the destination actually sees:
```python
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com/ip") # any endpoint that echoes the caller IP
print("connection exit:", page.inner_text("body"))
```
Then compare that against where your **DNS** appears to resolve from, using a resolver-echo
service that reports the address of the machine that queried it. If the connection exit and
the resolver-side address are in the same place, resolution is happening at the exit. If the
resolver address is your home ISP while the connection exit is the proxy's country, you have
found the leak. This is the same "measure the real path, through the proxy, not on localhost"
discipline described in [how to check a proxy for an IP leak](how-to-check-proxy-ip-leak.md),
and it belongs next to the WebRTC and timezone checks, because all three fail in the same
quiet way: a value that is individually plausible and disagrees with another value.
While you are checking exits, check the [timezone against the exit IP](timezone-proxy-mismatch.md)
too. A DNS leak and a timezone mismatch are the same category of tell: two surfaces that
should point at one location and do not.
## The honest caveat: this fixes the leak, not the reputation
Resolving names at the exit closes a specific, real gap: it stops your DNS from pointing
at your real network while your connection points somewhere else. That is worth doing, and
it is the default here for that reason.
It does not make the exit IP good. If the proxy's address is a known datacenter range, or
is already on shared blocklists, or is a country that does not match the rest of your
session, a perfectly consistent DNS path does not help. The name and the connection now
exit from the *same* place, but that place can still have a bad reputation. What decides
whether a datacenter exit is recognised as one is a separate question, covered in
[can websites detect a datacenter proxy IP](can-websites-detect-a-datacenter-proxy-ip.md).
The honest framing for the whole product is the same here as everywhere: invisible_playwright
is built to look like a real Firefox driven by a real person, which is why the fingerprint,
the TLS handshake and the driver layer read as genuine, and why it passes most detection
checks that inspect the browser. It does not supply a clean IP, per-account quotas, rate
limits, or human timing. You bring a reputable exit and sane pacing; the browser brings the
part that has to look real. A closed DNS leak is one clean surface among several, not a
finish line.
## Conclusion
A proxy can leak DNS whenever the host resolves names locally while the connection exits
elsewhere. Over SOCKS5 the fix is to hand the proxy a hostname to resolve at the exit rather
than an address you resolved at home, so names and connections leave from the same place.
DoH is a companion, not a replacement: it encrypts the lookup in transit but does not by
itself move where the lookup exits. Verify positively, comparing the connection exit against
the resolver-side address, and remember that closing the leak fixes location consistency,
not the reputation of the address you exit from.
## Short answers to the questions that lead here
**Does using a proxy hide my DNS?** Only if the proxy does the name resolution. If your
host resolves the name and then hands the proxy an IP, the lookup left your real network
and the connection did not, which is a DNS leak.
**What is the difference between remote and local DNS resolution?** Local means your machine
resolves the hostname before contacting the proxy; remote means the proxy resolves it at the
exit. SOCKS5 supports both, and only remote resolution keeps names and connections exiting
together.
**Does DNS-over-HTTPS stop a DNS leak?** Not by itself. DoH encrypts the query so the path
cannot read it, but if the encrypted query still leaves from your real network the leak of
location is unchanged. It answers "is my lookup readable", not "where does my lookup exit".
**Does invisible_playwright leak DNS?** No. It resolves DNS through the proxy by default, so
the name and the connection exit from the same place. You just pass a SOCKS5 proxy the normal
way.
**How do I check for a DNS leak?** Positively, through the browser session and not on
localhost. Compare the exit IP the destination sees against the address a resolver-echo
service reports; if they disagree in location, you have a leak.
**If my DNS no longer leaks, am I safe?** It fixes location consistency, not IP reputation.
A datacenter or blocklisted exit is still a datacenter or blocklisted exit after the leak is
closed.
## Sources
- The SOCKS5 protocol's two connect modes (address versus hostname), defined in
[RFC 1928](https://datatracker.ietf.org/doc/html/rfc1928), which is the mechanism that
makes proxy-side resolution possible at all.
- DNS Queries over HTTPS (DoH), standardized in
[RFC 8484](https://datatracker.ietf.org/doc/html/rfc8484), which encrypts the resolver
query in transit without changing where it exits.
- This project's proxy handling, which routes DNS through the proxy by default rather than
through the host resolver, and refuses a proxy endpoint given without an explicit port
rather than launching unproxied.
- The release gates behind the network pages in this set, including the exit-consistency and
WebRTC checks, which all assert a present, correct signal rather than the absence of a
wrong one.
**See also:** [how to check a proxy for an IP leak](how-to-check-proxy-ip-leak.md),
[SOCKS5 vs HTTP proxy for a browser](socks5-vs-http-proxy-browser.md), and
[Playwright SOCKS5 proxy with authentication](playwright-socks5-proxy-authentication.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The default that keeps DNS and
the connection exiting together is the whole point of this page; the reputation of the exit is
still yours to bring.*
@@ -0,0 +1,253 @@
---
title: "Does a VPN stop browser fingerprinting?"
description: "A VPN changes the IP a server sees, not the browser fingerprint. Why canvas, WebGL, fonts and timezone survive the tunnel, and what actually covers the fingerprint half."
parent: "Detectors, Explained"
grand_parent: "Guides"
nav_order: 12
---
# Does a VPN stop browser fingerprinting?
No. A VPN changes one thing: the IP address the server sees. The browser
fingerprint - canvas, WebGL, installed fonts, the user agent, the timezone, the
hardware counters - is exactly what it was before you connected. Worse, a VPN can
make a session look more suspicious rather than less, because it introduces a second
story about where you are and gives a detector two stories to compare.
This page is what a VPN moves, what it leaves in place, the specific way it can
backfire, and what has to cover the half it cannot.
## What a VPN actually changes
A VPN routes your traffic through a server somewhere else and presents that server's
address as the origin of every request. From the server's point of view, you are in
the country the exit sits in, on the network the exit belongs to. That is genuinely
useful and it is the entire effect: one field, the source IP, is replaced.
Everything a detector reads from *inside* the page is untouched, because none of it
travels through the tunnel as a value the VPN can rewrite. The page runs JavaScript
on your actual machine and asks your actual browser questions. The tunnel carries the
answers without changing them.
So the honest split is: a VPN is the network half. The fingerprint half is a
different problem with a different owner.
## What a VPN leaves untouched
Open any fingerprinting report through a VPN and read the fields rather than the
verdict. The address at the top has changed. Nothing below it has:
- **[Canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) and
[WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API).** The hash of a
rendered image and the GPU vendor and renderer strings come from your graphics stack.
A tunnel does not touch the graphics stack.
- **Fonts.** The installed-font list is read from the operating system. It still
describes your real machine, and if that is a server it still describes a server.
- **User agent and platform.**
[`navigator.userAgent`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent),
[`navigator.platform`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform),
[`navigator.oscpu`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/oscpu)
report the browser you are actually running.
- **Hardware counters.**
[`hardwareConcurrency`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/hardwareConcurrency),
[`deviceMemory`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/deviceMemory),
the audio device sample rate, the screen dimensions and device pixel ratio all come
from the box the browser runs on.
- **Timezone.**
[`Intl.DateTimeFormat().resolvedOptions().timeZone`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat)
reads your system clock's zone, which is set by your operating system, not by your
exit.
A commercial system hashes many of these together into a stable identifier. That
identifier is stable *across* IP changes by design, which means switching VPN exits
does not make you a new visitor. It makes you the same visitor from a new address,
which is its own pattern.
## When a VPN makes you more suspicious, not less
This is the part most guides skip. A VPN does not just fail to help the fingerprint
layer. It can actively contradict itself.
**The timezone that does not move.** Your exit is in one country; your system clock
is still in another. A detector reads the exit's geolocation and the browser's
reported timezone and sees two different places. A plain browser with no VPN at least
tells one consistent story. A VPN with an unaligned clock tells two, and disagreement
between values that should agree is precisely
[what timezone-versus-proxy checks look for](timezone-proxy-mismatch.md).
**The address that leaks past the tunnel.**
[WebRTC](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API) can enumerate
network candidates directly and, depending on configuration, surface an address the
VPN was supposed to hide, printed right next to the exit. That is the strongest
possible contradiction: the browser volunteering the very thing the tunnel exists to
conceal. It also fails the other way, returning nothing at all, which is itself a
signal that something is suppressing the API. Getting these to agree is a surface of
its own, covered in
[making the WebRTC address match the exit](webrtc-ip-match-proxy-exit.md).
**The reputation the exit already carries.** A shared VPN endpoint has been used by
thousands of other people, and a busy exit accumulates a reputation that has nothing
to do with your fingerprint. A perfectly ordinary browser on a known-bad exit is
detected on the exit alone.
None of these three is a fingerprint fix. Two of them are new ways to fail that you
did not have before you connected.
## The fingerprint half: what invisible_playwright controls
invisible_playwright is a Firefox patched at the C++ level and driven by stock
Playwright. It is built to look like a real browser driven by a real person, which is
why the fingerprint, the TLS handshake and the driver layer read as a genuine
Firefox rather than as automation. It owns the half a VPN cannot reach: it derives a
complete, internally consistent identity - GPU, canvas, audio, fonts, screen, roughly
400 fields - from a single seed, so the values agree with each other instead of being
a plausible field sitting next to a contradicting one.
Switching from plain Playwright is a two-line change, and the browser it returns is a
real Playwright `Browser` with every standard method:
```python
from invisible_playwright import InvisiblePlaywright
# proxy = the network half; the fingerprint half is handled by the engine
proxy = {"server": "socks5://gate.example.com:1080", "username": "u", "password": "p"}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com")
# navigator.userAgent, canvas hash, WebGL strings, fonts and timezone
# all describe one coherent machine, and the timezone follows the exit
```
Pass a `seed` and every field it implies comes back identical run after run, so a
session you want to reproduce is reproducible. Omit it and each session gets a
distinct identity. Either way, the fingerprint the page reads is a coherent whole
rather than your real machine wearing a new IP.
## Aligning timezone and geolocation to the exit
The specific failure a VPN introduces - a clock that contradicts the exit - is the
one the engine closes automatically. By default the browser timezone is derived from
the egress IP: the proxy exit if a proxy is set, otherwise the host's own public
address. The clock follows the exit instead of staying pinned to the host.
```python
# default: timezone auto-derived from the egress IP, so the clock matches the exit
with InvisiblePlaywright(proxy=proxy) as browser:
...
# an explicit IANA zone always wins, when you need to force one
with InvisiblePlaywright(proxy=proxy, timezone="America/New_York") as browser:
...
```
The geolocation and locale surfaces are aligned to the same exit rather than left to
disagree. When the network path cannot reach an external lookup, the derivation still
resolves from a bundled dataset rather than falling back to the host's zone, which is
[why the timezone stays correct offline](offline-geoip-timezone-proxy.md). The result
is that the tunnel and the browser tell one story, which is what a VPN on its own
cannot arrange.
## Measuring the difference
The claim is checkable, and checking it is the point. Run a fingerprinting report
twice through the same exit: once with a stock Firefox pointed at the VPN, once with
invisible_playwright pointed at the same proxy, and diff the two reports field by
field rather than reading the scores.
With the stock browser, the address at the top matches the exit and the rows below it
describe your real machine, including a timezone that may sit on a different continent
from the address. With the engine, the address matches the exit *and* the rows below
it describe one coherent machine whose clock, locale and geolocation sit in the same
place as the exit. The delta is every fingerprint field plus the timezone alignment -
which is exactly the half the VPN left untouched in the first report.
Run it at least ten times and space the runs out. This domain is non-deterministic,
and a single green run is not a result.
## What invisible_playwright does not do
The honest caveat, because overclaiming is both false and a liability. The engine
covers the fingerprint, the TLS layer and the driver tells. It does not supply the
network half and it cannot repair it:
- **IP reputation.** A poor-reputation exit is detected on its own, whatever the
fingerprint looks like. You supply a clean proxy; the engine does not launder a
dirty one.
- **Per-account quotas and rate limits.** These are counted server-side against your
account or your address, not read from the browser. Pacing is yours to manage.
- **Behaviour and timing.** Pointer motion is generated on a Bezier curve, but the
rhythm of a whole session - how fast you move between actions, whether an agent
pauses in a shape that looks like model latency - is yours to shape.
The framing that holds up: a VPN is the network half and invisible_playwright is the
fingerprint half. You need both, and a clean exit and human pacing on top of both.
## Conclusion
A VPN answers exactly one question a detector asks - where is this request coming
from - and leaves every other question answered by your real machine. On a bad day it
adds two contradictions, a stranded timezone and a WebRTC leak, that a plain browser
would not have produced. It is a necessary piece and not a sufficient one.
Cover the fingerprint layer with something built to look like a real browser, align
the clock and geolocation to the exit so the two halves agree, put a clean IP under
it, and pace the session like a person. A VPN does one of those four. Treat it as one
of four, not as the answer, and it does its job.
## Short answers to the questions that lead here
**Does a VPN change my browser fingerprint?** No. It changes the source IP and
nothing the page reads from inside the browser: canvas, WebGL, fonts, user agent,
timezone and hardware are unchanged.
**Can a VPN make detection worse?** Yes. If your system timezone does not match the
exit, or WebRTC leaks an address past the tunnel, you have handed a detector a
contradiction it would not otherwise have.
**Is a VPN the same as a proxy here?** For this purpose, close enough: both replace
the visible IP and neither touches the fingerprint. The engine takes a proxy directly
and aligns the browser's timezone to that exit.
**Will a VPN hide that I am automating?** No. Automation tells and the fingerprint
live in the browser, not the network. The address is the one thing the tunnel moves.
**Do I still need a good IP if my fingerprint is perfect?** Yes. A coherent browser
on a known-bad exit is detected on the exit alone. The two halves are independent.
**Does invisible_playwright include a VPN or proxy?** No. It handles the fingerprint,
TLS and driver layers and aligns the timezone to whatever exit you pass. You supply
the clean IP.
## Sources
- This project's release gates, including the WebRTC gate whose negative-only checks
once passed on a feature that was returning nothing, and the timezone derivation
that resolves the zone from the egress address.
- The public fingerprinting suites - CreepJS, BotD, FingerprintJS, sannysoft and
BrowserLeaks - read field by field before and after a VPN, which is where the
"one field changed, the rest did not" observation comes from.
- [MDN: `Navigator.userAgent`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent),
[`Navigator.platform`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform)
and [`Navigator.oscpu`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/oscpu),
the browser-reported properties a VPN cannot rewrite.
- [MDN: `Navigator.hardwareConcurrency`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/hardwareConcurrency),
[`Navigator.deviceMemory`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/deviceMemory)
and [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat),
the hardware and clock surfaces read straight from the host.
- [MDN: the Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API),
[the WebGL API](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API) and
[the WebRTC API](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API), the
graphics and networking surfaces a tunnel does not reach.
**See also:** [when the timezone does not match the proxy](timezone-proxy-mismatch.md)
for the contradiction a VPN introduces, and
[what no in-page test can see about the TLS handshake](ja3-ja4-tls-fingerprint.md) for
the network layer neither a VPN nor a fingerprint fix reaches from JavaScript.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The fingerprint half is
what it controls; the clean IP and the human pacing are still yours to supply.*
@@ -0,0 +1,209 @@
---
title: "Does chaining two proxies help avoid detection?"
description: "Chaining two proxies hides your origin from the first operator, but the target only ever scores the last exit IP - here is what a proxy chain changes and what it does not."
parent: "Network, Proxy and WebRTC"
grand_parent: "Guides"
nav_order: 27
---
# Does chaining two proxies help avoid detection?
Chaining proxies is one of those ideas that sounds like it should stack: if one hop
hides you, two hops must hide you more, and a site scoring your traffic should see
something twice as clean. It is a reasonable intuition and it is measuring the wrong
thing.
The target of your request sees exactly one address: the exit of the last hop. It has
no way to know whether that packet reached the last hop directly from your machine or
through five relays first, because a chain is invisible past its final link. So the
question this page answers honestly: a chain changes who can trace the traffic back to
you, not what the destination scores. Those are two different goals, and only one of
them is about detection.
## What the destination actually sees
A web server terminates a TCP connection from one peer. That peer is whatever machine
opened the socket to it, which for a proxied request is the last hop's exit. Every
signal the server can derive from the network layer - the source IP, its
[ASN and reputation](can-websites-detect-a-datacenter-proxy-ip.md), the reverse DNS,
the country, whether the range is residential or datacenter - is a property of that one
exit and nothing behind it.
Add a second proxy in front of the first and the picture at the destination does not
move. The exit is still the exit. If that final IP sits in a flagged datacenter range,
a second hop upstream of it does not launder the range, because the range that gets
scored is the one the packet leaves from. If the final IP is a clean residential
address, one hop or three hops behind it score identically.
This is the specific fact worth internalising: **the number of hops is not a field the
target can read.** It reads the last one and stops.
## Where a chain genuinely helps: who can trace you
A chain is not useless. It solves a real problem, just not the detection one.
With a single proxy, the operator of that proxy sees both ends: your real address on
the way in and the destination on the way out. They can correlate the two. Chaining
splits that knowledge across operators. The first hop sees your origin but not your
destination; the last hop sees your destination but not your origin. No single operator
holds both halves unless they collude or share ownership.
That is an operational-privacy property, and it is a real one:
- **Trust splitting.** You stop trusting any one provider with the full picture of who
is talking to what.
- **Jurisdiction separation.** Placing hops in different legal jurisdictions raises the
cost of compelling a single operator to hand over a correlation that no single
operator has.
- **Origin concealment from the entry node.** If you do not want the entry provider to
log your real IP against your traffic, a hop in front of it removes that link.
None of these change the score the destination computes. They change who could later
reconstruct the path. If your goal is "this site should not treat me as automated," a
chain does not address it. If your goal is "no single intermediary can build a profile
of my origin plus my destinations," a chain is exactly the tool.
## What a chain costs
Two hops are not free, and the costs land on the axes detection actually watches.
**Latency stacks.** Every hop adds a round trip and its own processing delay. A chain
that crosses two continents can add hundreds of milliseconds per request. Slow,
irregular response times are themselves a weak behavioural signal, and they make
human-like pacing harder to hit because your own timing floor is now higher and noisier.
**Failure points multiply.** A single proxy is one thing that can drop, throttle, or
inject. A chain is two, in series, and the compound reliability is the product of the
two. If each hop is up 99 percent of the time, the chain is up about 98 percent, and a
mid-session hop failure looks to the site like an abandoned or truncated session.
**The weakest exit still governs the score.** You can put a pristine entry node in front
of a tired, over-shared exit and gain nothing at the destination, because the exit is
what gets measured. Spending effort on the hop the target cannot see, while the hop it
can see stays dirty, is the common way a chain disappoints.
## How invisible_playwright fits: one server, chain built upstream
invisible_playwright routes the browser to a single proxy server. It writes the
[SOCKS](https://datatracker.ietf.org/doc/html/rfc1928) or HTTP preferences for one
endpoint and sends traffic there. It does not build a chain inside the browser, and
there is no per-request multi-hop setting to configure, because a chain is an upstream
network arrangement, not a browser feature.
If you want a chain, you build it below the address you hand the wrapper: the endpoint
you configure is the entry to your chain, and whatever it forwards to is your business
and invisible to both the browser and the destination. From the wrapper's point of view
it is one server - the same single `server` plus optional credentials shape that
[Playwright itself documents](https://playwright.dev/python/docs/network#http-proxy)
for launching a browser, passed straight through.
```python
from invisible_playwright import InvisiblePlaywright
# One endpoint. If this endpoint happens to be the entry of a chain you run
# upstream, the browser neither knows nor needs to - it sees a single hop.
proxy = {
"server": "socks5://entry.example.com:1080",
"username": "user",
"password": "pass",
}
with InvisiblePlaywright(seed=42, proxy=proxy) as browser:
page = browser.new_page()
page.goto("https://example.com")
# Read back the address the destination actually attributes to you -
# this is the LAST hop's exit, whatever sits behind it.
print(page.inner_text("body"))
```
The `browser` returned is a real Playwright `Browser`; every documented method works
unchanged. The important line is the last one: point it at a service that echoes the
requesting IP and you will read the exit of your chain, the same single address the
destination reads. Confirm it inside the browser rather than assuming it, and let
[the browser timezone auto-derive from that exit](timezone-proxy-mismatch.md) so the
address and the clock tell the same story.
## Why the fingerprint is the part chaining cannot touch
Here is the honest framing of what this product does and does not do.
invisible_playwright is a Firefox patched at the C++ level and driven by stock
Playwright, built to look like a real browser operated by a real person. That is why it
passes most detection checks that live in the browser: the fingerprint (GPU, canvas,
audio, fonts, screen, roughly 400 fields, seed-reproducible), the TLS handshake and the
driver layer all read as a genuine Firefox rather than an automated one. A CreepJS,
BotD, FingerprintJS or sannysoft run reads it as an ordinary browser because at those
layers it is one.
A proxy chain sits entirely below all of that. It cannot improve a fingerprint, because
the fingerprint is computed in the browser and shipped over whatever network you use. It
cannot fix a datacenter exit's reputation, per-account quotas, rate limits, or the
timing of your behaviour. Those are yours to supply: a clean exit,
[the right kind of proxy for the job](residential-datacenter-mobile-proxies-explained.md),
human pacing, and quotas you respect.
So the two layers are orthogonal. The browser makes you look like a real person's
browser. The exit IP decides whether that browser is arriving from an address the site
trusts. A chain rearranges trust among your proxy operators and does nothing to either
of those. If the exit is bad, chaining behind it does not help; the fix is a better
exit, or [rotating exits deliberately rather than accidentally](how-to-rotate-proxies-playwright.md).
## Conclusion
Chaining two proxies is a privacy tool, not a detection tool. It changes who can trace
your traffic back to you by splitting that knowledge across operators and jurisdictions,
and it does so at the cost of latency and an extra failure point. What it does not
change is the one thing the destination measures: the last exit's IP, its ASN and its
reputation. That value is identical whether one hop or three sit behind it.
If you are being scored as automated, look at the exit's reputation and the browser's
realness, not the number of hops. invisible_playwright handles the browser realness and
routes to a single server; the chain, if you want one, is something you build upstream
of that server for reasons that have nothing to do with the site's verdict.
## Short answers to the questions that lead here
**Does chaining two proxies make me harder to detect?** Not at the destination. It sees
only the last exit IP, so the chain behind it is invisible to the site's scoring.
**Then what is a proxy chain good for?** Hiding your origin from the first proxy
operator and splitting trust across operators and jurisdictions, so no single
intermediary sees both your origin and your destination.
**Will a chain clean up a bad exit IP?** No. The final hop is what gets scored. A clean
entry node in front of a flagged exit gains nothing at the target.
**Does invisible_playwright support multi-hop proxies?** It routes to one server. A
chain is built upstream of the endpoint you configure, not inside the browser, and the
browser sees a single hop.
**What is the cost of chaining?** Added latency at every hop and a second serial failure
point, so the compound uptime drops and your timing floor rises.
**If chaining does not help detection, what does?** A trustworthy exit IP plus a browser
that reads as a real one at the fingerprint, TLS and driver layers, together with human
pacing and quotas you respect.
## Sources
- This project's proxy handling, which configures a single endpoint per session and
auto-derives the browser timezone from that endpoint's egress.
- The network-layer fact that a TCP peer is the last hop only: a destination reads the
exit's address and cannot enumerate hops behind it.
- The release gates that measure fingerprint realness in the browser, which is a layer
no proxy arrangement touches in either direction.
- [RFC 1928, "SOCKS Protocol Version 5"](https://datatracker.ietf.org/doc/html/rfc1928),
the protocol a proxy endpoint speaks.
- [Playwright's own proxy configuration docs](https://playwright.dev/python/docs/network#http-proxy),
which document the single-endpoint `server`/`username`/`password` shape used above.
**See also:** [can websites detect a datacenter proxy IP](can-websites-detect-a-datacenter-proxy-ip.md),
[sticky versus rotating proxy sessions](sticky-vs-rotating-proxy-sessions.md), and
[why you might still be blocked with a clean fingerprint](why-blocked-with-a-clean-fingerprint.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser is built to
look real; the exit IP is still yours to choose, and a chain changes who can trace it,
not what the site scores.*
@@ -0,0 +1,201 @@
---
title: "Does clearing cookies stop fingerprint tracking?"
description: "No. Cookies are stateful and clearable, but fingerprinting is stateless and rebuilds the same identity from canvas, WebGL, fonts, audio and TLS every clear."
parent: "Browser Identity"
grand_parent: "Guides"
nav_order: 27
---
# Does clearing cookies stop fingerprint tracking?
Short version: no. Clearing cookies deletes something the site handed you and asked
you to hold. Fingerprinting never handed you anything to delete. It reads what your
browser is, every time you show up, and rebuilds the same identifier from scratch.
That is not an accident of the design, it is the whole point of it: fingerprinting
exists precisely because cookies can be cleared and it wanted an identifier that
could not.
This page explains the difference between the two, why the second one ignores the
first, what does change the identity, and where the honest limits of the fingerprint
layer are.
## What a cookie is, and what a fingerprint is
A cookie is state. The site writes a value into your browser, your browser stores it,
and it sends it back on the next request. Because it is stored, it can be deleted, and
when you clear it the site has to start over. This is a real, working privacy control
for the thing it controls.
A fingerprint is not stored anywhere on your machine for you to clear. It is computed
on the spot from properties your browser exposes: how it draws a
[canvas](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL),
which GPU and renderer string it reports through
[WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info),
which fonts it can load, how its
[audio stack](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API)
processes a signal, and, below the page entirely, how its TLS handshake looks. The
site hashes those together into an identifier. There is no file to remove because none
of it was ever written down on your side.
So the two answer different questions. A cookie asks "did I give you a token before?"
A fingerprint asks "are you the same machine as before?" Clearing the first has no
effect on the second.
## Why fingerprinting survives the clear
Stateful versus stateless is the entire story.
Clear your cookies, clear local storage, open a private window, and then reload a
fingerprinting page. The canvas still draws the same pixels, so it hashes to the same
value. WebGL still reports the same renderer. The font probe still finds the same
list. The audio path still returns the same numbers. Combine those and you get the
same identifier you had five minutes ago, because none of the inputs changed. The
[FingerprintJS visitor ID is a hash of exactly these components](fingerprintjs-visitor-id.md),
and a hash of unchanged inputs is unchanged output.
This is why "clear cookies between sessions" does not rotate you a new identity. It
rotates the one thing that was trivial to rotate and leaves untouched every signal
that was hard to. A detector that leans on the fingerprint rather than the cookie is
built specifically to not care what you did to your storage.
The corollary matters for automation: if you run a loop that clears cookies between
iterations expecting to look like a fresh visitor each time, every iteration presents
the identical fingerprint. You have not created many visitors, you have created one
visitor who keeps deleting their cookies, which is itself a pattern.
## What actually changes the identity
If the identifier is a hash of canvas, WebGL, fonts, audio and TLS, then the only way
to present a different identity is to change those underlying values so they hash
differently, and to change them together so they still agree with one another. A canvas
that says one machine next to a font list that says another is not a new identity, it
is a contradiction, and [contradictions are what the tampering-focused suites look for](creepjs-explained.md).
That is a much harder thing to do than emptying a cookie jar, which is the reason a
cookie clear can never do it. The cleared browser still renders canvas the same way and
still reports the same fonts. Changing those values in a self-consistent way is what a
fingerprint-management layer is for, and it is what invisible_playwright does per seed.
## Doing it with invisible_playwright
The product gives each seed a distinct, internally self-consistent fingerprint: a
different GPU, canvas hash, audio context, font set and screen, all derived together
so they agree with each other. Switching seeds is what a cookie clear is trying and
failing to be.
The launch is the standard two-line change, and the object you get back is a real
Playwright `Browser` with every method intact:
```python
from invisible_playwright import InvisiblePlaywright
# Seed A: one self-consistent machine
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# canvas, WebGL, fonts, audio all derived from seed 42
# Seed B: a genuinely different machine, not the same one with cookies wiped
with InvisiblePlaywright(seed=1337) as browser:
page = browser.new_page()
page.goto("https://example.com")
# different canvas hash, different renderer, different fonts
```
Two different seeds produce two different fingerprints. The same seed produces the
same one every run, which is the property that makes a failing run reproducible
instead of a guess:
```python
# Same seed, same identity, every run - the opposite of "clear and hope"
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# identical canvas hash and renderer to any other seed=42 run
```
If you want an identity to persist across separate sessions on purpose, that is a
profile decision rather than a cookie one: see [persistent profiles](persistent-profiles.md)
for keeping the same seed and storage across runs, and [cross-platform canvas and WebGL consistency](canvas-webgl-cross-platform-consistency.md)
for why the drawn pixels have to match the reported hardware on every OS you deploy to.
## The honest caveat: this is the fingerprint layer only
A distinct, self-consistent fingerprint is what makes invisible_playwright read as a
genuine Firefox driven by a real person, and it is why it passes most fingerprint, TLS
and driver-layer checks. It is not a claim that everything about you rotates when the
seed does.
Two things are tracked independently of both cookies and fingerprint, and the reader
supplies the answers to them:
- **Your IP and its reputation.** A brand-new fingerprint arriving from the same
datacenter address as the last hundred requests is still that address. The exit is
yours to choose, and a clean one matters as much as the browser does.
- **Account and behaviour state.** Per-account quotas, rate limits, session age and the
rhythm of what you do are counted against the account and the address, not the
fingerprint. Change the seed all you like, a burst of identical requests at machine
speed still reads as a burst. Human pacing is yours to supply.
So the accurate statement is: changing the fingerprint changes the fingerprint. It
helps a lot with the layer that reconstructs identity from canvas and TLS, and it does
nothing on its own for the layer that watches your address and your behaviour. Both
have to be right, and they are separate jobs.
## Conclusion
Clearing cookies removes the identifier the site stored on your side. Fingerprinting
was designed for exactly the world where people clear cookies, so it stores nothing on
your side and recomputes the identity from canvas, WebGL, fonts, audio and TLS every
time. The only way to look like a different visitor is to change those values together,
which a cookie clear cannot do and a per-seed fingerprint can. Just remember that this
is the fingerprint layer alone: your IP and your account behaviour are tracked on their
own, and they need their own clean inputs.
## Short answers to the questions that lead here
**Does clearing cookies stop fingerprinting?** No. Cookies are stored and deletable,
the fingerprint is recomputed from your browser's properties every visit, so a clear
leaves it unchanged.
**Does incognito or a private window give me a new fingerprint?** No. Private mode
clears storage, not the canvas, WebGL, font, audio and TLS values the fingerprint is
built from. Same machine, same fingerprint.
**Then how do I actually change my fingerprint?** By changing the underlying values in
a self-consistent way. In invisible_playwright that is a different seed, which redraws
the GPU, canvas, fonts, audio and screen together so they still agree.
**If I clear cookies in a loop, do I look like many visitors?** No. Every iteration
presents the same fingerprint, so you look like one visitor repeatedly clearing
cookies, which is its own pattern.
**Does a new fingerprint fix a blocked IP?** No. The address and its reputation are
tracked independently of both cookies and fingerprint. A clean exit is a separate
requirement you supply yourself.
**Will a per-seed fingerprint make me undetectable?** No, and be wary of anything that
says it will. It makes the fingerprint, TLS and driver layer read as a real Firefox,
which is most checks but not all of them. Behaviour, pacing and IP are still on you.
## Sources
- This project's fingerprint generator, which derives canvas, WebGL, font, audio and
screen values together from a single seed so a new identity is internally consistent.
- The public detection suites named across this set, read for which components feed
the identifier and which of them a storage clear leaves untouched.
- The release gates that separate the fingerprint layer from IP and behaviour, so a
clean fingerprint is never mistaken for a clean session.
**See also:** [the FingerprintJS visitor ID](fingerprintjs-visitor-id.md) for what the
hash is actually made of, [persistent profiles](persistent-profiles.md) for keeping one
identity on purpose, and [the JA3/JA4 TLS fingerprint](ja3-ja4-tls-fingerprint.md) for
the layer that no amount of cookie clearing or JavaScript ever reaches.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. Every session gets a
distinct, self-consistent fingerprint from its seed, which is the thing a cookie clear
was always trying and failing to be.*
@@ -0,0 +1,195 @@
---
title: "Does Playwright Change My Browser Fingerprint?"
description: "Stock Playwright does not randomize your fingerprint - it inherits the host browser's real values, which is how a Linux server leaks past a spoofed Windows user agent."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 23
---
# Does Playwright Change My Browser Fingerprint?
Short version: no. Stock Playwright launches a browser and hands you whatever that
browser reports on the machine it runs on. It does not randomize the fingerprint, it
does not repair it, and it does not make it look like anything other than what it is.
That surprises people who expected the automation layer to also be a disguise layer,
and the surprise usually arrives as a block on a server that worked fine on a laptop.
This page is what Playwright does and does not touch, the specific trap that catches
server deployments, and where a seed-derived identity replaces the values you inherit.
## What Playwright actually does to the fingerprint
Playwright drives a browser. It does not synthesize one. When you call
[`p.firefox.launch()`](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch),
the fingerprint you present is the real fingerprint of the real
Firefox on the real host: its GPU string comes from the host's graphics stack, its
font list from the host's installed fonts, its `navigator.platform` from the host OS,
its screen metrics from the host display, its audio characteristics from the host
audio device.
Playwright's job is the driver channel and the automation surface. It exposes a few
[context knobs](https://playwright.dev/python/docs/api/class-browser#browser-new-context) -
`user_agent`, `locale`, `timezone_id`, `viewport` - but those are
overrides you type in, not a coherent identity. Set a `user_agent` and you have
changed one string; every other value the page can read still comes from the machine.
That is the gap this whole page is about.
So the honest answer to the title is: Playwright inherits, it does not invent. If you
want a different machine, you have to supply one.
## The server-OS mismatch trap
Here is the exact failure, because it is the one that ships.
You develop on a Windows or Mac laptop, everything passes, you deploy to a Linux
server. Now the browser reports Linux fonts, a datacenter or software GPU renderer,
and a Linux `navigator.platform`. Then, because a lot of guides say to, you set a
Windows `user_agent` to "look normal".
You have just built a contradiction. A consistency detector does not care that any
single value is plausible. It cares whether values that must agree, do.
[CreepJS is built specifically to catch that](creepjs-explained.md): a user agent
claiming Windows, sitting on top of a font set that only exists on Linux, next to a
GPU string that only exists in a datacenter. Each field is fine alone. Together they
describe a machine that cannot exist, and that is a cleaner signal than any single bad
value would have been.
None of these are automation flags. They are "this is a Linux server wearing a Windows
costume" flags, and [they survive every JavaScript stealth plugin ever written](playwright-docker-detection.md)
because the fonts, the GPU and the platform are not in JavaScript's gift to change.
The [font list mismatch alone](headless-fonts-differ.md) is a one-line check on the
detector's side.
## What a seed-derived identity changes
invisible_playwright replaces the inherited values with a generated identity, and the
word that matters is *coherent*. From one seed it derives every surface together -
fonts, screen, device pixel ratio, canvas, WebGL vendor and renderer, audio, timezone,
platform - so they describe a single believable Windows machine instead of the host it
actually runs on. The Linux server underneath stops showing through, because the page
never reads the Linux values.
Two properties follow from deriving everything from one seed:
- **Consistency.** The user agent, the fonts, the GPU string and the platform are drawn
as one machine, so a cross-field detector finds agreement instead of a costume. This
is the same principle as
[keeping canvas and WebGL consistent across platforms](canvas-webgl-cross-platform-consistency.md):
the surfaces have to corroborate each other, not just each look normal in isolation.
- **Reproducibility.** The same seed yields the same identity every run. A
[FingerprintJS visitor ID](fingerprintjs-visitor-id.md) is a hash over many
components; feed it the same seed twice and you get the same ID, which is what lets
you replay a failing run exactly instead of hoping the next random draw reproduces it.
The default (no seed) still gives every session a distinct coherent identity. Passing a
seed just pins which one.
## A runnable example
Switching from stock Playwright is a two-line change, and after that every standard
Playwright method works unchanged, because the object you get back is a real Playwright
`Browser`.
```python
from invisible_playwright import InvisiblePlaywright
# same seed -> same coherent Windows identity, every run
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# navigator.platform, fonts, GPU, canvas, timezone all describe
# ONE machine - not the Linux host this happens to run on
print(page.evaluate("navigator.platform"))
```
Run that on your laptop and on a Linux server and the reported platform, fonts and GPU
match, because they come from the seed and not from the host. Log the seed if you did
not pass one, and you can reproduce the run later:
```python
sf = InvisiblePlaywright()
with sf as browser:
print("seed =", sf.seed) # replay this exact machine later
page = browser.new_page()
page.goto("https://example.com")
```
Async is the same shape with `from invisible_playwright.async_api import InvisiblePlaywright`
and `await` on the page calls. There is no wrapped subset of the API to learn;
see [the quickstart](quickstart.md) for the sync-versus-async pair side by side.
## The honest caveat: fingerprint is not everything
A coherent fingerprint fixes exactly one class of problem: the browser now reads as a
genuine Firefox on a consistent Windows machine, at the fingerprint, TLS and driver
layers. That is why it passes most detection checks that inspect what the browser *is*.
It does not fix what the browser *does*, and it does not fix where it connects from.
A perfect, seed-stable Windows identity coming out of a datacenter IP that a thousand
other clients are using this minute is still a datacenter IP. A perfect identity that
fills a form in eighty milliseconds and clicks without the pointer ever passing through
the space between two coordinates is still behaving like a script. The fingerprint is
not a disguise for a bad exit or robotic timing, and anyone who tells you a browser
alone makes you "undetectable" is selling the overclaim.
You supply the other two layers: a clean exit (see the
[proxy and timezone notes in configuration](configuration.md), where the browser
timezone auto-derives from the egress IP so those two stop contradicting each other),
and human pacing. The tool makes the machine coherent. The IP and the behaviour are
yours to get right.
## Conclusion
Playwright does not change your fingerprint - it inherits the host's, which is exactly
why a laptop-tested script fails on a Linux server the moment you paint a Windows user
agent over a Linux machine. A seed-derived identity closes that gap by generating every
surface together, so the fields corroborate one another instead of exposing the host,
and the same seed reproduces the same machine for debugging. Pair it with a clean exit
and human timing and it does the job it is built for. Treat it as a substitute for
those and it will not, and no honest tool claims otherwise.
## Short answers to the questions that lead here
**Does Playwright randomize the fingerprint?** No. It launches a browser and you
inherit that browser's real values on the host it runs on.
**Why does my scraper work locally but get blocked on a server?** Because the server
reports Linux fonts, a datacenter GPU and a Linux platform, which contradict the Windows
user agent you set. Consistency detectors read that mismatch directly.
**Does setting `user_agent` in Playwright change my fingerprint?** It changes one
string. The fonts, GPU, platform, screen and audio still come from the machine, so a
lone user-agent override usually creates a contradiction rather than hiding anything.
**What does a seed do?** It derives one coherent identity - fonts, screen, canvas,
WebGL, timezone - all describing the same Windows machine, and the same seed reproduces
it every run.
**Will a coherent fingerprint make me undetectable?** No. It helps with the fingerprint,
TLS and driver layers. It does nothing for a bad IP, per-account limits, rate limits or
robotic timing, and you have to supply those yourself.
**Is invisible_playwright still real Playwright?** Yes. The `browser` object is a real
Playwright `Browser`; every documented method works unchanged.
## Sources
- Playwright's own [launch](https://playwright.dev/python/docs/api/class-browsertype#browser-type-launch)
and [context](https://playwright.dev/python/docs/api/class-browser#browser-new-context) API,
read for what it does and does not override.
- This project's fingerprint generator, which derives every surface from one seed, and
the release gates that compare a generated identity field by field against a stock
Firefox on the same machine.
- The public consistency detectors named across this doc set, read from their own source
rather than from a rendered verdict.
**See also:** [what CreepJS actually checks](creepjs-explained.md),
[why a container gives itself away regardless of the stealth layer](playwright-docker-detection.md),
and [keeping canvas and WebGL consistent across platforms](canvas-webgl-cross-platform-consistency.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The server-OS mismatch in
this page is a mistake I shipped before I built the thing that fixes it.*
@@ -0,0 +1,201 @@
---
title: "Does Playwright Get Detected on the First Request?"
description: "Yes, detection can happen before JavaScript runs: the TLS handshake and HTTP/2 settings form a fingerprint a Playwright script can contradict on request zero."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 27
---
# Does Playwright Get Detected on the First Request?
Yes, it can, and the surprising part is that it can happen before a single line
of your page's JavaScript runs. People picture detection as something that
inspects `navigator.webdriver` or reads a canvas hash after the page loads. Those
are real, but they are late. The first thing a server sees from you is not a
DOM, it is a TLS handshake and the opening frames of an HTTP/2 connection, and
those carry a fingerprint of their own.
If that network fingerprint says one client while your `User-Agent` header says
Firefox, the two disagree on request zero, before any script has a chance to
tidy anything up. This page is about that gap, why a real patched browser does
not have it, and the honest limits of what "no gap" buys you.
## What the server sees before your JavaScript runs
A page load is not one event, it is a sequence, and the browser has already
described itself twice before your code executes.
First is the TLS handshake. The [ClientHello](https://datatracker.ietf.org/doc/html/rfc8446) message lists the cipher suites
the client offers, the extensions it sends, the elliptic curves it supports and
the order of all of it. That ordering is not random and it is not the same
across clients: a given browser build produces a characteristic shape, and
hashing that shape is what JA3 and JA4 do. [The full mechanics of how a
handshake becomes a fingerprint](ja3-ja4-tls-fingerprint.md) are a page of their
own, but the short version is that the network stack has a signature and the
signature is legible.
Second, once the encrypted connection is up, HTTP/2 opens with a `SETTINGS`
frame and a set of window and priority values. The exact numbers, and the order
they arrive in, differ between engines and between an engine and a generic HTTP
library that merely speaks the protocol. [HTTP/2 settings are a fingerprint in
the same way](http2-fingerprint-detection.md): distinctive, sent up front, and
impossible to edit from inside the page because the page does not exist yet.
Both of these are decided by whatever actually made the connection. Not by a
header you set. Not by a property you patched. The transport layer answers for
itself.
## Why the mismatch is the tell, not the fingerprint itself
A JA3 hash on its own is not incriminating. Plenty of legitimate clients have
unusual handshakes. What gets flagged is a contradiction: a handshake that
belongs to one client sitting underneath a `User-Agent` header that names a
different one.
This is the same failure that shows up everywhere else in fingerprinting. A
detector rarely asks "is this value rare". It asks "do two values that must
agree, agree". Here the two values are the network fingerprint and the claimed
browser. If a request presents a TLS signature that a generic HTTP client
produces, and the header says it is Firefox on Windows, that is not a subtle
statistical wobble. It is a flat contradiction, visible on the first packet,
with no page interaction required. [The mismatch between a TLS fingerprint and
the User-Agent](tls-fingerprint-user-agent-mismatch.md) is one of the cleanest
signals a server has, precisely because the two sources are independent and hard
to fake in lockstep.
This is why bolt-on stealth is fragile at the network layer. You can override
every JavaScript property you like, and the handshake still comes from whatever
library or headless build actually opened the socket. The disguise is applied
above the layer where the contradiction lives.
## Why a real patched Firefox has no gap here
invisible_playwright takes the approach that avoids the mismatch by construction:
it drives a real Firefox, patched at the C++ level, using stock Playwright. The
handshake is not spoofed to look like Firefox. It is Firefox's handshake, because
the process performing it is Firefox.
That distinction is the whole point. When the TLS `ClientHello` goes out, it is
emitted by a genuine Gecko network stack, so the JA3 and JA4 it produces are the
ones a real Firefox of that version produces. When HTTP/2 opens, the `SETTINGS`
frame carries the values that engine actually uses. The `User-Agent` header then
names Firefox and is telling the truth, so there is nothing for a request-zero
comparison to catch. There is no second client hiding under the first, because
there is only one client.
Switching to it is a two-line change, and the network behaviour comes along for
free because it was never something you were configuring:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# The TLS handshake and HTTP/2 frames on this request are a real
# Firefox's, and the User-Agent header matches because it is not a spoof.
```
The `browser` here is a real Playwright `Browser`, so every method you already
use works unchanged. The `seed` fixes the in-page fingerprint (GPU, canvas,
audio, fonts) so a run is reproducible, but the network-layer identity does not
depend on the seed at all: it is the same genuine Firefox handshake on every
session, because that is what the process is.
If you want to confirm this rather than take it on faith, the honest method is a
comparison. Capture the handshake from a session driven this way and from a stock
Firefox on the same machine, and diff the JA3 or JA4. They should match, because
it is the same engine. That is the same "compare, do not read a verdict"
discipline that the [testing guide](how-to-test-bot-detection.md) argues for at
every layer.
## The honest caveat: a matching handshake is table stakes
Here is the part that a slogan would skip. A correct TLS and HTTP/2 fingerprint
means you do not fail the request-zero mismatch check. It does not mean you pass
request zero.
The server judges the handshake and the IP that sent it at the same instant. A
perfect Firefox `ClientHello` arriving from an address with a bad reputation, a
datacenter range, or an exit that a thousand other clients are using this minute,
is still a bad first impression. The network fingerprint being clean removes one
signal; it does nothing about the address underneath it, and the address is
evaluated on exactly the same first packet.
So the layer split is worth stating plainly. invisible_playwright is designed to
look like a real browser driven by a real person, and that is why it clears the
fingerprint, TLS and driver checks: those read as a genuine Firefox because it is
one. What it does not do, and cannot do, is supply the things that are not
browser properties:
- **IP reputation.** The engine sends the handshake; you choose what sends it.
Route it through a clean, ideally residential exit. [Proxy configuration and
the DNS handling that goes with it](configuration.md) is where that is set.
- **Rate limits and per-account quotas.** A real browser making a thousand
identical requests a minute is still a thousand requests a minute.
- **Behaviour and timing.** After request zero, the session is judged on how it
moves. Human pacing is your responsibility, and for agent workloads the pause
shaped like model latency is [its own consideration](ai-browser-agents-stealth.md).
A matching handshake is necessary and not sufficient. It is the floor you have to
be standing on before anything else you do matters, not the ceiling.
## Conclusion
Detection on the first request is real, and it lives below JavaScript: the TLS
handshake and HTTP/2 settings describe the client before the page loads, and a
network fingerprint that contradicts the `User-Agent` is one of the earliest and
cleanest signals a server has. The durable answer to it is not a better spoof but
a real engine, which is why driving a genuine patched Firefox means the handshake
matches the header by construction. Pair that with a clean exit and human pacing,
and request zero stops being the place you get caught. Leave the exit dirty and it
still is, no matter how perfect the handshake.
## Short answers to the questions that lead here
**Can I be detected before my JavaScript runs?** Yes. The TLS handshake and the
HTTP/2 `SETTINGS` frame are sent before the page loads and both carry a
fingerprint, so a mismatch is visible on the first request.
**What is a JA3 or JA4 fingerprint?** A hash of the shape of the TLS
`ClientHello`: the cipher suites, extensions and curves and the order they appear
in. Different clients produce different shapes.
**Why does a matching handshake matter if the header already says Firefox?**
Because the header is trivially set and the handshake is not. When they disagree,
the handshake is believed and the header is treated as a lie.
**Can I fix the TLS fingerprint from JavaScript or a stealth plugin?** No. The
handshake happens below the page, before any script runs. The only real fix is
for the actual client to be the browser it claims to be.
**Does a real Firefox handshake mean I will not be blocked?** No. It clears the
network-fingerprint mismatch, but the IP that sent the handshake is judged at the
same moment, and reputation, rate limits and behaviour are all still yours to
handle.
**Does the seed change the network fingerprint?** No. The seed fixes the in-page
identity so runs are reproducible; the TLS and HTTP/2 fingerprint is the genuine
engine's and is the same regardless.
## Sources
- The TLS 1.3 and HTTP/2 specifications for what the `ClientHello` and `SETTINGS`
frames actually contain, and the public JA3 and JA4 definitions for how those
are hashed into a fingerprint.
- This project's own comparison method: capturing a handshake from a session and
from a stock Firefox on the same machine and diffing the result, rather than
trusting a verdict.
**See also:** [JA3 and JA4 TLS fingerprints](ja3-ja4-tls-fingerprint.md) for the
handshake mechanics, [the TLS-versus-User-Agent mismatch](tls-fingerprint-user-agent-mismatch.md)
for why the contradiction is decisive, and [HTTP/2 fingerprint detection](http2-fingerprint-detection.md)
for the layer just above it.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The handshake is
real because the browser is real; the exit and the pacing are still yours to get
right.*
+233
View File
@@ -0,0 +1,233 @@
---
title: "Does Playwright Leave Traces a Website Can See?"
description: "Playwright leaves some traces a page can read, some it cannot. Which are page-visible, why the control WebSocket is not, and how patched Firefox reads ordinary."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 22
---
# Does Playwright Leave Traces a Website Can See?
Short version: Playwright leaves traces, but only some of them are readable by the
page you are visiting. The distinction matters more than the list, because most of the
famous "Playwright tells" are things the page can see in its own document, and the part
people worry about most - the connection the driver uses to control the browser - is not
one of them.
This page splits automation traces into two piles, page-visible and off-page, shows a
DOM check you can run yourself, explains why Chromium-based tooling and Firefox differ on
one specific tell, and states plainly where a clean document still is not enough.
## Two kinds of trace: what the page can read, and what it cannot
A running automation session has two very different surfaces.
**Off-page.** The driver talks to the browser over a control channel: a local
WebSocket or pipe that carries the commands your script issues (navigate, click, read
this element). That channel lives between your process and the browser process. The page
being automated has no handle to it, cannot open it, and cannot enumerate it. It is
server-side relative to the document, in the same sense a debugger attached to a process
is invisible to the code running inside.
**Page-visible.** Everything the automation writes into the document or the global
scope. If a tool sets a property on `navigator`, defines a global, or injects a helper
object into `window`, then any script the page runs can read it back with one line. This
is the pile that detectors actually query, because it is the only pile they can reach
from JavaScript.
The useful question is therefore never "does Playwright leave traces" but "which pile is
this trace in". A trace in the first pile is not something a page can test for. A trace
in the second pile is a one-line check, and that is where the work is.
## The control channel: a trace, but not one the page can see
The WebSocket (or pipe) is real. If you inspect your own machine while a session runs,
it is right there. But it is off-page, and that has a concrete consequence: a website
cannot detect automation by looking for the driver connection, because nothing in the
document reaches across that boundary.
This is why "close the DevTools port" style advice misses the point for in-page
detection. Whether the transport is a Chrome DevTools Protocol socket, a WebDriver BiDi
session, or Firefox's own Juggler protocol, the page sees the same thing either way:
nothing. The differences between those transports show up in other places -
[the protocol a tool speaks changes what artifacts land in the page](bidi-vs-cdp-detection.md) -
but the raw existence of a control socket is not a page-readable signal.
What the page reads is the residue the driver leaves behind in the document. That is the
next pile.
## The traces a page CAN see
Three families, in rough order of how often they appear:
- **A webdriver flag.** The [WebDriver specification](https://www.w3.org/TR/webdriver2/)
requires a conforming browser to expose `navigator.webdriver` as `true` while a session
is under automation control. That is a page-visible boolean by design, and a stock
automated browser reports it honestly. Patching it in a page script trades one tell for
another, because a clean browser reports `undefined` and not `false` - the
[full reason setting it to false is worse than leaving it alone](navigator-webdriver-explained.md)
is its own page.
- **Automation globals.** Some stacks leave a named object on `window` so their in-page
code has somewhere to keep state. Anything on the global object is enumerable, so a
named global is a named tell.
- **Injected document properties.** On Chromium-based tooling driven through
ChromeDriver, the driver keeps working state on the document under `cdc_` / `$cdc`
property names. Their presence is a one-line automation test, and
[renaming them in the binary does not remove the surface](cdc-variable-explained.md),
it only changes its shape.
All three are page-visible because they live in the document or the global scope. None of
them is the control channel. Fixing them is a matter of not writing them into the page in
the first place, which is a design decision, not a runtime patch.
## Chromium injects cdc_ into the document; Firefox through Juggler does not
Chromium-based tooling writes `cdc_`-prefixed properties into the page; Firefox driven
through Juggler writes none, because its driver never has to touch the document at all.
ChromeDriver needs to run its own JavaScript inside the page to do its job, and it keeps
state on the page's own objects under `cdc_`-prefixed names. That is a page-visible
artifact of how that particular driver works.
Firefox driven through its own Juggler protocol does not use ChromeDriver, so `cdc_`
simply does not exist there. That is a fact about the protocol, not a claim of virtue:
Firefox's automation state lives in privileged execution contexts the page cannot
enumerate, so the driver does not have to write into the document to function. The
`cdc_` family of checks returns nothing on a Firefox session for a structural reason.
That structural point is only half the story, though, because a stock Firefox under
automation still sets the webdriver flag to `true`. So "no `cdc_`" does not mean "looks
like a person" on its own. What closes the remaining gap is where the value is decided.
On the patched Firefox this project ships, the webdriver flag is cleared and the
fingerprint is normalized inside the engine, before it ships, so the document a site
inspects reports the same values a normal build reports, through the same native code
path. There is no in-page override for a detector to catch, because there is no override.
The wider comparison of the two engines lives in
[Firefox versus Chromium for anti-detect work](firefox-vs-chromium-antidetect.md).
## Check the document yourself
Do not take any of this on trust. Enumerate the document and the global scope in your own
session and read what is there. With the real API the launch is two lines and the check
is one `page.evaluate`:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
report = page.evaluate("""() => ({
webdriver: navigator.webdriver,
cdc_on_document: Object.getOwnPropertyNames(document)
.filter(k => k.startsWith('cdc_') || k.startsWith('$cdc')),
suspicious_globals: Object.getOwnPropertyNames(window)
.filter(k => /^(cdc_|\\$cdc|__playwright|__driver|__webdriver)/.test(k)),
})""")
print(report)
```
On this patched Firefox, `webdriver` comes back `undefined` (not `false`), and both
lists come back empty: no `cdc_` on the document, no automation global on `window`. The
same check on a stock ChromeDriver session is where you see the `cdc_` entries appear.
Passing `seed=42` just means the run is reproducible, so you can re-run the exact same
identity and compare - the
[wider method for testing detection](how-to-test-bot-detection.md) is to compare against
a stock browser field by field rather than reading a single verdict.
Note what this check does not include: the control-channel WebSocket. There is no
expression you can write in `page.evaluate` that finds it, because it is off-page. That
absence is the point of this whole page.
## What this fixes, and what it honestly does not
Clearing the page-visible traces is what makes invisible_playwright pass most in-document
detection: the automation flag, the injected globals, and the fingerprint (GPU, audio,
fonts, screen, roughly 400 fields) all read as a genuine Firefox, because they are
produced by a genuine, if patched, Firefox. That is the demonstrable part, and the DOM
check above is how you confirm it for yourself.
"No page-visible traces" is not the same as "invisible", and it is worth being blunt
about the difference:
- **The network layer.** The TLS handshake and HTTP/2 settings are decided before any
page script runs, and [an in-page test cannot see them](ja3-ja4-tls-fingerprint.md),
which cuts both ways: a clean document does not fix a handshake that contradicts the
user agent. The patched engine's handshake is a real Firefox handshake, so this
particular mismatch is not introduced, but the point stands that this surface is
outside the document.
- **IP reputation.** A consistent browser on a datacenter address is still on a
datacenter address. That is not a browser property, and no amount of fingerprint work
changes it. You supply a clean exit, and the browser stays consistent with it.
- **Per-account quotas and rate limits.** If an account or a source address makes more
requests than a person plausibly would, that is measured server-side and is invisible
to any document check.
- **Behaviour and timing.** Pointer motion, typing rhythm, and pacing are watched by
some sites regardless of how clean the document is. This project drives real mouse
motion, but the cadence of your script is yours to make human.
So the honest framing: invisible_playwright is built to look like a real browser driven
by a real person, which is why it clears the page-visible driver and fingerprint layer.
It does not, on its own, fix your IP, your account limits, or your pacing. Those are the
reader's to supply - a clean proxy and human timing - and a page that reads as ordinary
plus a session that behaves ordinarily is the combination that actually holds.
## Conclusion
Playwright leaves traces, but sort them before you worry about them. The control channel
is a real trace and the page cannot see it, so it is not a detection vector from the
document. The webdriver flag, automation globals, and Chromium's `cdc_` injection are
page-visible, and those are the ones detectors query. Firefox through Juggler carries no
`cdc_` for a structural reason, and a Firefox patched in the engine additionally clears
the webdriver flag and normalizes the fingerprint, so the document reads as an ordinary
browser. Confirm that with the one-line DOM check rather than believing the paragraph.
Then remember that a clean document is a necessary condition, not a sufficient one: the
network, the address, the account, and the behaviour are still yours to get right.
## Short answers to the questions that lead here
**Does Playwright leave traces a website can detect?** Some yes, some no. Automation
globals, a webdriver flag, and (on Chromium tooling) `cdc_` properties are page-visible.
The driver's control WebSocket is off-page and a document cannot see it.
**Can a website see the WebSocket Playwright uses to control the browser?** No. That
channel is between your process and the browser process. Nothing in the page has a handle
to it, so it is not an in-page detection signal.
**Does Firefox have the `cdc_` variables Chrome does?** No. Those come from ChromeDriver.
Firefox driven through its Juggler protocol keeps driver state off the page, so a `cdc_`
scan returns nothing on a Firefox session.
**Is `navigator.webdriver` always true under automation?** On a stock automated browser,
yes, because the spec requires it. On the patched Firefox this project ships it is cleared
in the engine, so it reports `undefined` like a normal browser, not `false`.
**If the document is clean, am I undetectable?** No. A clean document does nothing about
IP reputation, per-account quotas, rate limits, the TLS handshake, or your timing. Those
are separate surfaces you have to handle yourself.
**How do I check what my own session exposes?** Enumerate `window` and `document` in a
live session with `page.evaluate` and read `navigator.webdriver`, as in the example
above, then compare the result against a stock browser on the same machine.
## Sources
- This project's own sessions, enumerating `window` and `document` on a live
Playwright-driven Firefox rather than trusting a description of one.
- The public detection suites (CreepJS, BotD, sannysoft, FingerprintJS, BrowserLeaks),
each read from its own source for what it collects from the document.
- The Playwright, [WebDriver BiDi](https://www.w3.org/TR/webdriver-bidi/), and Juggler
protocol behaviour for where driver state lives relative to the page.
**See also:** [the ChromeDriver cdc_ variable](cdc-variable-explained.md),
[why navigator.webdriver is not the tell you think it is](navigator-webdriver-explained.md),
and [how to test whether your browser is detected](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The DOM check above is one
I run against a real session before repeating any claim about what a page can see.*
@@ -0,0 +1,210 @@
---
title: "Does Playwright Set navigator.webdriver to True?"
description: "Stock Playwright reports navigator.webdriver as true, an old automation tell. Why patching it is detectable, and what a native false looks like to detectors."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 21
---
# Does Playwright Set navigator.webdriver to True?
Short version: yes. A browser launched by stock Playwright reports
[`navigator.webdriver`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver) `=== true`, and it has done so for years. That single boolean is
one of the oldest and cheapest automation tells there is, which is exactly why so many
people try to patch it and why the patch usually makes things worse.
This page is what the flag is, why setting it to `false` from JavaScript is itself a
signal, what a native `false` looks like to a detector, and the honest limit of what
clearing it buys you.
## The one-line answer, and the check that proves it
The flag is specified. The [WebDriver standard](https://www.w3.org/TR/webdriver2/) says a browser under automation control
must expose `navigator.webdriver` as `true`, so Playwright, Selenium and any other
WebDriver-based driver all set it. Read it yourself:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
print(page.evaluate("() => navigator.webdriver"))
```
On a plain Playwright launch of the same engine that prints `True`. The value above
comes back `False`, and the rest of this page is about why the difference between those
two lines is not one character of JavaScript.
A clean, human-driven browser reports `false` here. Note that this is different from the
Chromium story, where an untouched browser reports `undefined` and a hand-set `false` is
itself an anomaly. On Firefox the honest value is a plain `false`, which is what this
engine returns.
## Why that boolean is such an old tell
It costs a detector nothing. One property read, no timing, no fingerprint math, no
iframe. It is the first line of almost every detection script ever written, and it
catches the enormous number of scrapers that never touch it at all.
Because it is so cheap, it is also the first thing every serious tool fixes, which means
that by itself it separates almost nobody from almost nobody. It matters for the reverse
reason: leaving it `true` marks you instantly, so it is table stakes rather than an
advantage. The interesting question is not whether the flag reads `false`, it is
*how* it came to read `false`, because that is where the second tell lives.
## Why a JavaScript patch of the flag is itself detectable
The obvious fix is to overwrite the property from a script that runs before the page:
```js
// the classic, and the trap
Object.defineProperty(navigator, "webdriver", { get: () => false });
```
This does make `navigator.webdriver` return `false`. It also leaves two fresh
fingerprints that are easier to check than the original flag.
**The getter is no longer native code.** In a real browser the property is backed by an
internal getter implemented in C++. Ask that getter to describe itself and it says so:
```js
Object.getOwnPropertyDescriptor(Navigator.prototype, "webdriver")
.get.toString();
// real browser: "function get webdriver() { [native code] }"
// JS override: "() => false" <-- the whole source, in plain sight
```
Every function in JavaScript carries its own source, and
[`Function.prototype.toString`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) hands it back. A native builtin answers with the
`[native code]` placeholder; your arrow function answers with its actual body. So the
override that was supposed to hide automation has instead written the word `false` into
a place a detector can read directly. This is the general ceiling on page-level stealth,
and it is worth understanding on its own terms in
[the note on toString and the native-code check](tostring-native-code-detection.md).
**The property moved to the wrong object.** On a real Firefox the `webdriver` accessor
lives on `Navigator.prototype`, not on the `navigator` instance. `defineProperty` on
`navigator` puts an own property on the instance, so `navigator.hasOwnProperty("webdriver")`
flips from `false` to `true` and the descriptor now sits one rung lower on the prototype
chain than it should. A detector that walks the chain, which the tampering-focused suites
do by design, sees the shape change even when the value is correct.
The pattern is the one that runs through
[the whole checklist for being flagged on a single site](playwright-detected-as-bot.md):
a value fixed in isolation contradicts a value nobody thought to fix. Setting the boolean
right while leaving the getter's source and its location wrong is two new tells in
exchange for one old one.
## What a native false looks like to a detector
The way out is not a better shim, it is to not have a shim. This engine is a Firefox
patched at the C++ level, so `navigator.webdriver` is `false` because the browser's own
internals return `false`, the same code path a normal Firefox uses. There is no
JavaScript getter to inspect and no instance property to trip over:
```python
from invisible_playwright import InvisiblePlaywright
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
report = page.evaluate("""() => {
const desc = Object.getOwnPropertyDescriptor(
Navigator.prototype, "webdriver");
return {
value: navigator.webdriver,
ownProp: navigator.hasOwnProperty("webdriver"),
getterSource: desc && desc.get.toString(),
};
}""")
print(report)
# {'value': False,
# 'ownProp': False,
# 'getterSource': 'function get webdriver() { [native code] }'}
```
All three answers match a browser nobody automated: the value is `false`, the property
is not an own property of the instance, and the getter still reports `[native code]`.
There is nothing here for a descriptor walk or a `toString` probe to catch, because the
thing they look for was never added. The same reasoning, at more length and with the
history of the flag, is in
[why navigator.webdriver is not the tell you think it is](navigator-webdriver-explained.md).
## The honest caveat: necessary, not sufficient
Clearing this flag correctly is table stakes, and table stakes are not a win. A `false`
`navigator.webdriver` is one boolean among dozens of signals, and it says nothing about
the surfaces that actually get datacenter automation caught:
- **The IP.** A perfectly clean browser on a known or datacenter address still loses,
and no browser property changes that. You supply the exit.
- **Rate and volume.** Per-account quotas, request velocity and how many sessions share
one address are counted server-side, where the driver flag is invisible.
- **Behaviour and timing.** A pointer that teleports, a form filled in eighty
milliseconds, keystrokes at a metronome interval. This engine draws mouse motion on a
Bezier curve, but the pacing of your actions is yours to make human.
- **The rest of the fingerprint.** GPU, fonts, audio device, screen, the TLS handshake.
These read as a genuine Firefox here, which is the whole design, but they are a system
you keep consistent, not a switch you flip once.
invisible_playwright is built to look like a real browser driven by a real person, which
is why it passes most detection checks at the fingerprint, TLS and driver layers. It does
not, and cannot, fix a bad IP, a blown quota or robotic timing. The
[method for actually testing which layer is failing](how-to-test-bot-detection.md)
is worth more than any single flag reading, because it tells you whether the thing you
fixed was ever the thing catching you.
## Conclusion
Stock Playwright sets `navigator.webdriver` to `true` by specification. Patching it from
JavaScript trades one obvious tell for two subtler ones: a getter whose source reads
`false` under `toString`, and a property that has migrated onto the wrong object. A
native `false`, returned by the browser's own C++ path, leaves neither, which is why this
engine returns `false` without a shim to catch. Treat that as necessary and never as
sufficient: it clears the driver layer, and the IP, the pacing and the behaviour are
still yours to get right.
## Short answers to the questions that lead here
**Does Playwright set navigator.webdriver to true?** Yes, on every WebDriver-based
launch, because the standard requires an automated browser to report `true`.
**Can I just set navigator.webdriver to false in a script?** You can, and the value will
read `false`, but the override's getter no longer reports `[native code]` and the
property lands on the wrong object, so you have added two tells to remove one.
**How do detectors catch the JavaScript override?** By reading the getter's source with
`Function.prototype.toString`, and by walking the prototype chain to see that the
property moved onto the instance.
**What should a clean Firefox report?** A plain `false`. That is different from Chromium,
where an untouched browser reports `undefined` and a hand-set `false` is itself odd.
**Does invisible_playwright fake the value?** No. It returns `false` from the browser's
own native code path, so there is no JavaScript getter to inspect and no own property to
find.
**If navigator.webdriver is false, am I undetectable?** No. It is one boolean among many
signals. It does nothing for your IP reputation, your rate limits or your behaviour, all
of which you still have to supply.
## Sources
- The WebDriver specification, which defines `navigator.webdriver` and requires an
automated user agent to expose it as `true`.
- `Function.prototype.toString`, whose `[native code]` behaviour for builtins is the
standard mechanism behind the getter-source check.
- This project's own driver-layer checks, comparing a native `false` against a
JavaScript override on the same engine.
**See also:** [Function.prototype.toString and the native-code check](tostring-native-code-detection.md),
[why navigator.webdriver is not the tell you think it is](navigator-webdriver-explained.md),
and [the checklist for being detected on one site](playwright-detected-as-bot.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The flag reads false
because the browser's own code returns false, not because a script overwrote it.*
@@ -0,0 +1,208 @@
---
title: "Does Playwright Support Firefox Stealth?"
description: "Stock Playwright drives a plain Firefox with no stealth layer, so automation signals show. Put the spoofs in a patched browser and keep the standard Playwright API."
parent: "The Automation Layer"
grand_parent: "Guides"
nav_order: 25
---
# Does Playwright Support Firefox Stealth?
Short answer: Playwright drives Firefox well, but it does not make Firefox
stealthy. The bundled Firefox it launches is an ordinary build, and it exposes
the same automation signals any driver would. Stealth is not something the
driver can add, because the driver is not where the signals live. It has to be
compiled into the browser.
That distinction is the whole answer, and the rest of this page is why it is
true and what to do about it.
## The short version: stealth lives in the browser, not the driver
A browser automation stack has two halves. The driver is the process that sends
commands - click here, go there, read this element. The browser is the process
that renders the page and answers every fingerprinting question a site asks:
what GPU do you have, what fonts, what is `navigator.webdriver`, what does your
TLS handshake look like.
Detection happens entirely in the second half. A site never sees your driver.
It sees the browser's answers. So a stealth layer has to change what the browser
reports, which means it has to be inside the browser. A patched driver talking
to an unpatched browser changes nothing a detector can read.
Stock Playwright is a very good driver. It is not, and does not try to be, a
stealth browser.
## What stock Playwright's Firefox actually exposes
Playwright ships [its own Firefox build](https://playwright.dev/python/docs/browsers)
and talks to it over the Juggler protocol. That build is a normal Firefox with
the automation hooks enabled. It was never meant to hide, so it does not:
- [`navigator.webdriver`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver)
reports the automated state.
- The fingerprint is whatever the host machine happens to have. On a server that
means a software WebGL renderer, no audio device, a font set that belongs to
the container rather than to the platform the user agent claims, and a screen
size nobody actually runs.
- The TLS handshake is the build's own, which [no in-page test can see but a
server-side detector can](ja3-ja4-tls-fingerprint.md).
None of this is a defect in Playwright. It is a driver doing its job. But it
means "use Playwright with Firefox" and "have a stealthy Firefox" are two
different projects, and the first does not get you the second.
## Why patching the driver is the wrong layer
The common instinct is to reach for a stealth plugin: a piece of JavaScript
injected into every page that overwrites the properties a detector reads. This
works at the edges and fails at the core, for a reason that is structural rather
than a matter of plugin quality.
Injected JavaScript runs after the page's own code can already have captured the
original built-ins, and a serious check compares the built-ins against a clean
copy taken from a fresh iframe. An overwrite leaves a fingerprint of its own: a
patched function has a different `toString`, a redefined property has a
telltale descriptor, and [setting `navigator.webdriver` to `false` is itself a
signature because a real browser reports `undefined`](navigator-webdriver-explained.md).
The machine tells - GPU, fonts, audio, screen - are not in JavaScript's gift to
change at all.
So the driver layer can paper over a handful of properties and cannot touch the
rest. The deeper you push the disguise, the closer to the engine it has to be.
[The full ladder of where a spoof can live, and what each rung can and cannot
reach, is its own page](playwright-stealth-levels.md).
## The split invisible_playwright uses: stock Playwright, patched Firefox
This is exactly the split invisible_playwright is built on. The driver stays
stock: an unmodified, current Playwright, with the standard API and nothing
wrapped or subsetted. The stealth moves entirely into the browser, which is a
Firefox patched at the C++ level so the spoofs are compiled in - `webdriver`
reads the way a normal browser's does, the fingerprint surfaces (GPU, canvas,
audio, screen, fonts) are answered from a seed-derived identity, and real fonts
are bundled so the list matches the platform being claimed.
Because the disguise is in the engine and not in an injected script, there is no
overwritten built-in to catch and no second spoofer contradicting the first. And
because the driver is ordinary Playwright, switching is two lines and every
method you already know keeps working:
```python
from invisible_playwright import InvisiblePlaywright
# seed=42 makes the whole identity reproducible run to run
with InvisiblePlaywright(seed=42) as browser:
page = browser.new_page()
page.goto("https://example.com")
# the browser, not a plugin, answers this - and it reads like a real one
print("webdriver:", page.evaluate("navigator.webdriver"))
print("renderer:", page.evaluate(
"document.createElement('canvas').getContext('webgl')"
".getParameter(0x1F01)"))
```
The `browser` object is a real
[`playwright.sync_api.Browser`](https://playwright.dev/python/docs/api/class-browser).
Everything in the upstream Playwright documentation applies unchanged; the only
difference is what the browser reports when a page asks. The async surface is
identical:
```python
from invisible_playwright.async_api import InvisiblePlaywright
async with InvisiblePlaywright(seed=42) as browser:
page = await browser.new_page()
await page.goto("https://example.com")
print(await page.evaluate("navigator.webdriver"))
```
Run the first snippet against a plain Playwright Firefox and against this one and
diff the two reports field by field. The plain build announces automation and a
server machine; the patched build reads like a real desktop Firefox, and the
same seed produces the same reading every time.
## What this fixes and what you still supply
Here is the honest boundary, because the split above solves one layer and one
layer only.
What the patched browser handles: the fingerprint, the driver tells, and the TLS
handshake all read as a genuine Firefox. That is most of what a public detection
suite - CreepJS, BotD, FingerprintJS, sannysoft, BrowserLeaks - actually
measures, and it is why a well-configured session passes most of those checks.
What it does not, and cannot, handle on its own:
- **IP reputation.** A perfect browser on a known datacenter address still loses.
You supply a clean exit; [the proxy configuration is its own
page](configuration.md).
- **Per-account quotas and rate limits.** These are about the account and the
request volume, not the browser.
- **Behaviour and timing.** Pointer motion, typing rhythm, and the pace of a
session are yours to make human. The tool arcs the mouse on a Bezier curve, but
it will not invent realistic pauses for you.
Looking like a real browser is necessary and not sufficient. This is not an
undetectable browser and there is no such thing; it is a browser that looks real,
paired with the parts only you can supply. Anyone selling "bypass everything" is
selling the half of the problem that is not theirs to sell.
## Conclusion
Does Playwright support Firefox stealth? It supports driving Firefox, and stealth
is not a driver feature - it belongs in the browser, so the right answer is stock
Playwright plus a patched Firefox rather than a patched Playwright. That keeps the
standard API and moves the disguise to the only layer that a detector can read.
It gets you a browser that looks real, which is most of the battle and not all of
it. The clean IP and the human pacing are still yours to bring.
## Short answers to the questions that lead here
**Does Playwright have a stealth mode?** No. It is a driver, and the bundled
Firefox it launches is a normal build that exposes the usual automation signals.
Stealth has to be added in the browser.
**Can a stealth plugin make Playwright's Firefox undetectable?** It can hide a
few properties and it leaves its own signature doing so, and it cannot touch the
machine tells - GPU, fonts, audio, screen. Injected JavaScript is the wrong layer
for the hard part.
**Do I have to patch Playwright itself?** No, and you should not. Patch the
browser and keep Playwright stock, so the standard API stays intact and the
disguise sits where detectors actually look.
**Will this pass every bot check?** It passes most fingerprint, driver, and TLS
checks because those read as a real Firefox. It does nothing about your IP,
your quotas, or your behaviour, and those get sessions blocked too.
**Do I have to change my Playwright code?** Two lines at launch. The returned
object is a real Playwright `Browser`, so every method works exactly as
documented upstream.
**Is Firefox better than Chromium for this?** They have different tradeoffs;
[the comparison is its own page](firefox-vs-chromium-antidetect.md).
## Sources
- [Playwright's own docs on the Firefox build it drives](https://playwright.dev/python/docs/browsers),
and the [`Browser` class reference](https://playwright.dev/python/docs/api/class-browser),
read from their own behaviour rather than a summary of it.
- [MDN's `navigator.webdriver` reference](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver)
for what the property signals and when.
- This project's release gates, which assert the patched browser reports a real
fingerprint and driver state, run through a proxy and compared field by field
against a stock browser on the same machine.
**See also:** [the levels a stealth layer can live at](playwright-stealth-levels.md),
[what navigator.webdriver really signals](navigator-webdriver-explained.md), and
[Firefox versus Chromium for anti-detect](firefox-vs-chromium-antidetect.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. The split it is built
on is the whole point of this page: keep the driver ordinary, put the disguise in
the browser.*
+192
View File
@@ -0,0 +1,192 @@
---
title: "Does Playwright Trigger reCAPTCHA More Often?"
description: "Why Playwright triggers reCAPTCHA more often. How reCAPTCHA builds risk from fingerprint, IP, session and behavior, and which inputs a browser engine can control."
parent: "Testing and Troubleshooting"
grand_parent: "Guides"
nav_order: 13
---
# Does Playwright Trigger reCAPTCHA More Often?
Often, yes, but not for the reason most people assume. There is no single "this is
Playwright" flag that reCAPTCHA flips. What it does is build a risk score out of many
inputs, and a default Playwright session happens to push several of those inputs in the
same wrong direction at once.
That distinction matters, because it tells you which parts of the problem the browser can
fix and which parts it cannot. This page walks the inputs, shows which one a coherent
real-browser engine moves, and is honest about the ones that no browser setting touches.
## reCAPTCHA is a score, not a switch
The useful mental model is a risk score between "obviously a person" and "obviously
automated", with a threshold somewhere in the middle. Below the threshold you get a quiet
pass or an invisible check. Above it you get a challenge, and above that you get blocked
outright.
Nothing about that score is a boolean. You do not "fail the Playwright test" and you do
not "pass" it. You accumulate a number, and every input either adds to it or does not.
This is the same machinery described in
[how a browser trust score is actually assembled](browser-trust-score-explained.md): a
weighted sum, not a checklist, which is why fixing one obvious tell can leave you still
above the line.
So the right question is not "does Playwright get detected". It is "which inputs does a
default Playwright session push over the threshold, and which of those can I move".
## The inputs that feed the score
Four families of input matter here, and they are largely independent of each other.
- **Fingerprint coherence.** Not whether any single value is unusual, but whether the
values agree. A user agent claiming one platform against APIs that behave like another,
a GPU string that does not match how pixels actually render, a font set that does not
belong to the claimed operating system. Detectors mostly check agreement, not novelty.
- **IP reputation.** The address and its ASN. A datacenter range, an exit that a thousand
other sessions used this minute, a country that disagrees with the rest of the session.
- **Session and cookie age.** A brand-new context with no cookies and no history looks
different from a browser someone has actually used. reCAPTCHA reads longevity and prior
interaction as signal.
- **Interaction pattern.** Pointer motion, typing rhythm, the pause before a click. A form
filled in eighty milliseconds and a pointer that teleports between coordinates both
score against you.
A default Playwright launch tends to be bad at the first and the third for free: a fresh
automated context ships an inconsistent fingerprint and a historyless session in the same
breath. That is most of why the challenge rate is higher than a hand-driven browser's,
before you have touched the proxy at all.
## Which input the browser layer actually moves
Of those four, exactly one is fully inside the browser's gift: fingerprint coherence.
Stock Playwright driving stock Firefox or Chromium leaks a scattering of small
disagreements. Some are automation tells like
[`navigator.webdriver`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver), a
standard property that reports true whenever the user agent is under automation control. More
are consistency gaps: a headless context with no real GPU, a screen size no display has, a codec
list or font set that does not match the claimed platform. Each is a small addition to the
score, and together they are the fingerprint contribution.
You can see this contribution directly rather than taking it on faith. Open the same
detector page in your automated browser and in a stock browser on the same machine, and
diff the reports field by field. The
[method for doing that comparison honestly](how-to-test-bot-detection.md) is worth reading
before you trust any single verdict, because a green score can also mean a broken feature
that leaks nothing.
The other three inputs are not browser properties at all, which is the honest half of this
page and the reason a "stealth browser" alone is never the whole answer.
## What invisible_playwright does, and a two-line example
invisible_playwright is a Firefox patched at the C++ level and driven by stock Playwright.
Its job on this specific problem is narrow and it is the fingerprint input: instead of a
scattering of disagreements, it presents one coherent real Firefox. GPU, audio, fonts,
screen and roughly 400 fields are derived together from a single seed, so they agree with
each other and with a genuine desktop Firefox rather than contradicting one another.
Switching from plain Playwright is two lines, and every Playwright method works unchanged
because the returned object is a real Playwright
[`Browser`](https://playwright.dev/python/docs/api/class-browser):
```python
from invisible_playwright import InvisiblePlaywright
# seed=42 makes the identity reproducible: same GPU, fonts, canvas hash every run
with InvisiblePlaywright(seed=42, proxy={
"server": "socks5://gate.example.com:1080",
"username": "user",
"password": "pass",
}) as browser:
page = browser.new_page()
page.goto("https://example.com/form")
page.click("#submit") # pointer arcs to the button on a Bezier curve
```
The reproducible seed is what makes the fingerprint input debuggable: if a run draws a
challenge, replay the exact same identity and change one variable at a time, rather than
guessing whether the site changed or the machine did.
What this buys you is a lower fingerprint contribution to the score. The TLS handshake and
driver layer also read as a genuine Firefox rather than as something impersonating one,
which closes the network-layer tells covered in
[JA3 and JA4 TLS fingerprinting](ja3-ja4-tls-fingerprint.md). It does not touch the other
three inputs, and it does not "solve" the score. There is no such thing.
## The inputs the browser cannot move
A coherent fingerprint on a bad address is still on a bad address. These are the inputs you
have to supply yourself, and no browser setting substitutes for them:
- **IP reputation.** Around ninety percent of proxies are already known and blocked before
you use them. A perfect browser on a listed datacenter IP still scores high. This is the
first thing to rule out, and the [Docker and datacenter side of the
problem](how-to-run-playwright-docker-undetected.md) is where most server-side sessions
actually lose.
- **Session age.** A brand-new context with zero cookies reads as fresh every time. Warming
a session, reusing storage state, and not throwing away every cookie between runs all move
this input, and none of them are the browser's job.
- **Behaviour and timing.** Mechanical pacing scores against you regardless of how real the
browser looks. Human-shaped delays and real pointer motion are things you pace from your
own code. invisible_playwright supplies Bezier-curve mouse motion, but the rhythm of when
you act is yours.
If your fingerprint is coherent and you are still challenged, the score is coming from one
of these three, and buying a better browser will not change it.
## Conclusion
Playwright meets reCAPTCHA challenges more often because a default automated session pushes
several score inputs the wrong way at once, chiefly an inconsistent fingerprint and a fresh,
historyless session. A real-browser engine like invisible_playwright moves the fingerprint
input, and the TLS and driver layers with it, which is a real and measurable reduction in
one contribution to the score. It does not, and cannot, fix IP reputation, session age, or
your timing. Treat reCAPTCHA as a sum you lower from several directions, not a switch one
tool flips, and pair a coherent browser with a clean exit and human pacing.
## Short answers to the questions that lead here
**Does Playwright itself get flagged by reCAPTCHA?** Not as a single flag. A default
Playwright session raises the risk score mainly through an inconsistent fingerprint and a
brand-new session with no history, which together read as automation.
**Will a stealth browser stop reCAPTCHA challenges?** It lowers one input, the fingerprint,
and the TLS layer with it. It does nothing for your IP, your session age, or your timing, so
on its own it does not stop challenges.
**Can any browser guarantee a pass?** No. reCAPTCHA produces a score from inputs the browser
does not control, so no browser setting "solves" it. Anyone claiming otherwise is selling
something.
**Why do I still get challenged with a perfect fingerprint?** Because the score has other
inputs. A datacenter IP, a cookieless session, or mechanical timing can each push you over
the threshold on their own.
**Does a reproducible seed help here?** Yes, for debugging. The same seed gives the same
machine every run, so a challenge can be replayed exactly instead of chasing a new random
identity each time.
**Is it the proxy or the browser?** Test it: open the same page by hand from the same
machine and network. If the manual visit is also challenged, it is the exit, and the
[detection checklist](playwright-detected-as-bot.md) works that split in order.
## Sources
- This project's fingerprint generation, which derives roughly 400 fields from one seed so
they agree with each other rather than contradicting.
- The comparison method in the testing guide linked above, used to read the fingerprint
contribution to a score directly rather than trusting a verdict.
- Public detector suites (CreepJS, BotD, FingerprintJS, sannysoft, BrowserLeaks), each read
from its own source, for what a coherence check actually inspects.
**See also:** [how a browser trust score is assembled](browser-trust-score-explained.md),
[the checklist for being detected on one site](playwright-detected-as-bot.md), and
[how to test whether your browser is detected](how-to-test-bot-detection.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
a Firefox patched at the C++ level driven by stock Playwright. It moves the fingerprint
input to a reCAPTCHA score; the clean exit and the human pacing are still yours to bring.*
Loaded 100 of 476 files, more files were not shown because too many files have changed in this diff. Show more