Skip to content
All fingerprint checksAutomation surface

a focused child frame implies its parent document is focused

Check id document-focus-vs-realm

What an ordinary browser yields

Whenever a child frame reports focus, this document reports focus too. Both unfocused, or parent-focused-child-not, are ordinary states.

What a detector infers

document.hasFocus() is true when the document OR any of its descendants holds focus, which makes it hierarchical rather than local: a focused child frame necessarily means its parent document reports focus too. That implication is the only thing assertable here, and the check asserts precisely it and nothing more. Both documents reporting false is the ordinary state of a background tab; the parent reporting true while the child reports false simply means focus lives somewhere else in the page. Only the reverse — a child that claims focus while its parent denies it — is impossible, because focus cannot exist inside a frame without existing in the document that contains it. The reason it is worth checking at all is that faking foregroundedness is a rational thing for automation to do: browsers throttle timers and rAF in background tabs, which slows a headless run badly, so tooling patches the page into claiming focus and visibility. Patching a hierarchical property in one document without its ancestors is the natural mistake, and it is what this reads. Severity is warn.

How to resolve it

Do not patch document.hasFocus() to claim foregroundedness — focus is hierarchical, so a claim made in one document has to hold for its ancestors as well, and a child that outranks its parent is impossible rather than merely unusual. Foreground the page rather than asserting that it is.

How is a headless browser detected?

Read in the wild by

Kasada

Reads focus on both sides of the frame boundary, where the relationship is hierarchical.

document_has_focus, parent_document_has_focus

Kasada ips.js teardown — the full 427-probe list

Every attribution traces to a published artifact. See the sources and their limits.

Nearby checks in Automation surface

See all 27 checks in Automation surface
Who builds this test

Clearcote is a browser built for fingerprint coherence

It is a Chromium fork, maintained by the same people who wrote this reference. It ships as a compiled browser rather than as a stealth script injected into someone else's — which is a description of how it is built, and is not an argument about how it behaves on this check.

This audit takes no position on how Clearcote scores on Automation surface checks, on this one, or anywhere else. It has no baseline corpus of other people's fingerprints to rank you against and no vendor scoreboard — nearly every check is self-referential, asking one browser the same question through two independent APIs and reporting whether both answers can be true at once. It runs identically on any browser, including ours. Run it on yours and read the result yourself.

See the other checks in Automation surface — the family document-focus-vs-realm belongs to.