navigator.taintEnabled() is a legacy Navigator method from JavaScript 1.2 data tainting. MDN: that model was removed long ago; the method remains only for old scripts and always returns false.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call navigator.taintEnabled. Start with this line.
JavaScript
navigator.taintEnabled()
Call
What it does
navigator.taintEnabled()
Primary signature.
navigator.taintEnabled(...)
Call with the arguments your case needs.
Built into the browser. Call taintEnabled(...) on a Navigator — no import required.
Library declarations
JavaScript
navigator.taintEnabled()
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
Always false when implemented
JavaScript Examples
Example 1 — Feature-Detect First
Many engines never expose taintEnabled. Check before calling.
Recognize this pattern in old scripts — the branch never runs today.
JavaScript
// Legacy pattern (do not copy into new apps):
if (typeof navigator.taintEnabled === "function" && navigator.taintEnabled()) {
console.log("tainting on"); // never prints
} else {
console.log("tainting off / unsupported");
}
// Prefer modern security instead of this check.
Old scripts gated behavior on tainting being enabled.
Today the call is false, so the if body never runs.
Missing method also falls through to the else path.
Replace with CSP / permissions — not this stub.
Compatibility
Browser Support
navigator.taintEnabled() is a legacy Gecko compatibility stub. MDN: always returns false when present. Chrome and Safari typically do not implement it.
MDN: it always returns false. It is a leftover from JavaScript 1.2 data tainting, kept only so very old scripts do not break.
Yes in practice — MDN lists it among deprecated Navigator methods. The tainting security model was removed long ago; the method is only a compatibility stub that returns false.
Data tainting was removed after JavaScript 1.2. Engines that still expose taintEnabled() keep it for compatibility, and the HTML rule is to return false.
Limited. Mainly Firefox / Gecko compatibility. Chrome and Safari typically do not implement it. Always feature-detect before calling.
No. if (navigator.taintEnabled()) never enables a real security feature. Prefer modern APIs (CSP, permissions, CORS, SameSite cookies, etc.).
Both are historical stubs that return false when present. javaEnabled() was about the Java plugin; taintEnabled() was about JS 1.2 data tainting. javaEnabled() is widely present; taintEnabled() is more Firefox-oriented.