Optional ReadonlyglobalsOverride the global navigator / window / indexedDB lookups. Used in
tests; in production the live globals are used.
Optional ReadonlyprivateAdvanced override. The Chromium strategy classifies a tab as private
when its storage headroom (estimate().quota - estimate().usage) is
below this many bytes. Defaults to 9.5 GiB — the midpoint between the
10 GiB headroom Chrome reports for a normal tab and the 9 GiB it reports
for an incognito tab.
Only change this if you have measured your audience.
Optional ReadonlysignalAn AbortSignal that cancels detection. If it is already aborted
when detectIncognito is called, the call rejects synchronously;
if it aborts while a probe is running, the probe is abandoned. Either way
the rejection is an IncognitoDetectionError with code: 'ABORTED'.
Pair it with a component lifecycle so a verdict that arrives after the user has navigated away is discarded.
Optional ReadonlytimeoutMaximum time, in milliseconds, to wait for a verdict. If detection has not
settled by the deadline it rejects with an IncognitoDetectionError
whose code is 'TIMEOUT', and any in-flight storage probe is abandoned.
Defaults to undefined — no deadline (legacy behaviour). Because a
storage probe can, in rare browser states, stall indefinitely (e.g. a
Firefox indexedDB.open request that never fires success/error),
passing a bound such as 5000 is recommended on any critical render
path (paywalls, analytics gates) so a stalled probe can never freeze the
calling code.
Options for detectIncognito.