navigator.taintEnabled() is a legacy stub from JavaScript 1.2 data tainting. When the method exists it always returns false. Learn its history, limited browser support, five examples, and why modern security uses other tools.
01
Kind
Method
02
Returns
false (always)
03
Status
Legacy stub
04
Support
Limited (often Firefox)
05
History
JS 1.2 tainting
06
Practical tip
Do not branch on it
Fundamentals
Introduction
In very early JavaScript (around 1.2), some engines experimented with data tainting — a security idea that marked values from untrusted sources so scripts could not misuse them casually.
That model was removed long ago. Per MDN, navigator.taintEnabled() remains only so extremely old scripts do not break, and it always returns false when present.
💡
No Dep / Exp / Non-standard banner
MDN’s method page and BCD do not mark this API Experimental or Non-standard, and BCD sets deprecated: false. Tainting itself is obsolete; treat the method as a compatibility stub (similar spirit to javaEnabled()), not a live security switch.
Concept
Understanding the taintEnabled() Method
No parameters — call navigator.taintEnabled().
Return type — boolean false when the method exists.
Feature-detect first — many Chromium / Safari builds omit it.
HTML / Gecko note — the HTML Standard keeps it mainly for Gecko compatibility mode.
Not a modern security API — use CSP, Permissions Policy, CORS, and related tools instead.
Foundation
📝 Syntax
General form of the method:
JavaScript
navigator.taintEnabled()
Parameters
None.
Return value
Always the boolean false when the method is implemented.
Safe call pattern
JavaScript
const value =
typeof navigator.taintEnabled === "function"
? navigator.taintEnabled()
: null; // missing in this browser
console.log(value); // false or null
Cheat Sheet
⚡ Quick Reference
Goal
Code
Feature detect
typeof navigator.taintEnabled === "function"
Call (if present)
navigator.taintEnabled()
Expected result
false
Strict equality
navigator.taintEnabled() === false
Do not use for
Real security / “is tainting on?” UX
Prefer instead
CSP, Permissions Policy, CORS, modern APIs
Snapshot
🔍 At a Glance
Four facts to remember about navigator.taintEnabled().
Returns
false
When present
Support
Limited
Often Firefox
Banners
none
Not Dep / Exp / NS
Use for
learning
Not feature gates
Compare
📋 taintEnabled vs javaEnabled
taintEnabled()
javaEnabled()
Historical topic
JS 1.2 data tainting
Java browser plugin / applets
Today’s result
Always false if present
Always false
Availability
Limited (Gecko-oriented)
Widely present (Baseline)
New projects
Ignore for product logic
Ignore for product logic
Hands-On
Examples Gallery
Examples show how to detect the method, confirm the always-false contract, and avoid treating it as a live security switch. Output may say missing on Chromium / Safari.
📚 Getting Started
Detect the method, then call it safely.
Example 1 — Feature Detection
Many browsers omit taintEnabled. Check before calling.
{"taintEnabled":false,"isSecureContext":true,"cookieEnabled":true,"tip":"Use CSP / Permissions / CORS — not taintEnabled()"}
(taintEnabled may be "missing")
How It Works
Keep taintEnabled() for history lessons; ship modern platform security features.
Applications
🚀 Common Use Cases
Learning / interviews — explain JS 1.2 tainting and why the stub returns false.
Reading ancient scripts — recognize dead if (taintEnabled()) branches.
Engine quirks — understand Gecko compatibility vs Chromium omission.
Teaching feature detection — contrast missing APIs vs always-false stubs.
Not for product security — never gate CSP or auth on this method.
navigator.taintEnabled() is a legacy compatibility stub. Per MDN / BCD it is present mainly in Firefox (and historically IE / old Opera). Chrome and Safari typically omit it. When present, the return value is always false.
✓ Limited · Always false
Navigator.taintEnabled()
JS 1.2 tainting leftover — returns false for old-script compatibility.
LimitedNot universal
Mozilla FirefoxMethod present · always false
Supported
Google ChromeTypically not implemented
Unavailable
Microsoft EdgeTypically not implemented (Chromium)
Unavailable
Apple SafariTypically not implemented
Unavailable
OperaRemoved in modern Opera / Chromium era
Unavailable
Internet ExplorerHistorical support · always false later
Legacy
taintEnabled()Limited (stub)
Bottom line: Feature-detect before calling, expect false when present, and never use this method for modern security decisions.
Wrap Up
Conclusion
navigator.taintEnabled() is a leftover from JavaScript 1.2 data tainting. Feature-detect it, expect false when it exists, and do not build security UX around it. Modern apps rely on CSP, permissions, CORS, and secure contexts instead.
Legacy JS 1.2 stub — always false when the method exists.
5
Core concepts
🔒01
History
JS 1.2 tainting
Removed
📊02
Result
always false
Stub
🌐03
Support
Limited
Often Firefox
🔎04
Detect
typeof function
First
🚫05
Avoid
security gates
Use CSP+
❓ Frequently Asked Questions
It is a legacy Navigator method from the old JavaScript 1.2 data-tainting security model. Today, when the method exists, it always returns the boolean false.
MDN’s method page and browser-compat data do not mark it Experimental or Non-standard, and BCD sets deprecated to false. Tainting itself was removed long ago; the method is only a compatibility stub. No Deprecated / Experimental / Non-standard status banner is required on this tutorial.
Data tainting was removed after JavaScript 1.2. Engines that still expose taintEnabled() keep it only so very old scripts do not throw, and the HTML rule is to return false.
Support is limited. It is mainly a Firefox / Gecko compatibility API. Chrome and Safari typically do not implement it. Always feature-detect before calling.
No. Calling it teaches history, but 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.
Did you know?
The HTML Standard still mentions taintEnabled() mainly so Gecko’s navigator compatibility mode can match old content fingerprints — the method must return false, not revive tainting.