navigator.globalPrivacyControl is a Boolean Global Privacy Control (GPC) signal for sell/share consent. Learn true vs false, the Sec-GPC header, how it differs from deprecated DNT, five examples, and try-it labs.
01
Kind
Read-only property
02
Returns
Boolean
03
Status
Experimental
04
true
Do not sell/share
05
false
Consent or unset
06
HTTP twin
Sec-GPC
Fundamentals
Introduction
Privacy laws often talk about “do not sell” or “do not share” personal information. Global Privacy Control (GPC) is a browser signal that expresses that preference for the current website.
navigator.globalPrivacyControl is read-only. When the API exists, it returns a Boolean that mirrors the Sec-GPC HTTP header — so both your front end and your server can see the same preference.
💡
Not a full compliance framework
Reading GPC is one input. You still need a privacy policy, consent UI where required, and legal advice for your jurisdiction. GPC is a signal — not a complete solution by itself.
Concept
Understanding the globalPrivacyControl Property
Think of GPC as a site-scoped “please don’t sell or share my data” switch the user (or their browser/extension) can turn on.
true — user explicitly does not consent to sell/share with third parties.
false — user grants consent or has not indicated a preference (MDN).
Missing property — browser does not support GPC in JS — feature-detect.
Sec-GPC — the matching HTTP header for server-side handling.
Foundation
📝 Syntax
General form of the property:
JavaScript
navigator.globalPrivacyControl
Value
A Boolean: true or false when the property is supported.
Common patterns
JavaScript
// MDN-style log:
console.log(navigator.globalPrivacyControl);
// true if the user opted out of sell/share; otherwise false (when supported)
// Safe feature-detect:
if ("globalPrivacyControl" in navigator) {
if (navigator.globalPrivacyControl === true) {
// Disable sell/share integrations for this visit
}
} else {
// Fall back to your consent banner / legal defaults
}
Four facts to remember about navigator.globalPrivacyControl.
Returns
boolean
true / false
Status
experimental
Not Baseline
true means
no sell/share
Explicit opt-out
Header
Sec-GPC
Same preference
Compare
📋 GPC vs doNotTrack
globalPrivacyControl
doNotTrack
Meaning
Do not sell/share personal info
Old “don’t track me” ask
Type
Boolean
"1" / "0" / null
MDN status
Experimental
Deprecated + Non-standard
HTTP
Sec-GPC
DNT
New apps
Prefer (when supported)
Avoid
Hands-On
Examples Gallery
Examples follow MDN Global Privacy Control / navigator.globalPrivacyControl patterns. Prefer Try It Yourself to inspect your browser. Use View Output for expected messaging.
When supported, you get a real Boolean — not the strings "true" / "false".
📈 Practical Patterns
Labels, sell/share gating, and a structured helper.
Example 3 — Human-Readable Label
Translate the Boolean into a short status line for a privacy debug panel.
JavaScript
function gpcLabel() {
if (!("globalPrivacyControl" in navigator)) {
return "GPC: unsupported";
}
return navigator.globalPrivacyControl
? "GPC: do not sell/share"
: "GPC: consent or no preference";
}
console.log(gpcLabel());
Remember MDN: false covers both “granted consent” and “no preference indicated.”
Example 4 — Gate Third-Party Sharing
Skip a fictional “share with partners” path when GPC is true.
JavaScript
function mayShareWithPartners() {
if ("globalPrivacyControl" in navigator &&
navigator.globalPrivacyControl === true) {
return false;
}
// Otherwise use your consent banner / defaults
return true; // demo default — replace with real consent state
}
console.log("may share?: " + mayShareWithPartners());
may share?: true
(false when GPC is explicitly true)
How It Works
When GPC is unsupported, do not invent an opt-out — use your existing consent flow.
Example 5 — Structured Privacy Helper
Combine GPC with a deprecated DNT read for migration dashboards only.
JavaScript
function privacySignals() {
return {
globalPrivacyControl:
"globalPrivacyControl" in navigator
? navigator.globalPrivacyControl
: "unsupported",
doNotTrack: navigator.doNotTrack, // deprecated — diagnostic only
advice:
"Prefer GPC when present; do not build new logic on DNT"
};
}
console.log(JSON.stringify(privacySignals()));
navigator.globalPrivacyControl is Experimental and not Baseline. Availability varies by browser and extension. Always feature-detect and keep a consent fallback.
✓ Experimental · Not Baseline
Navigator.globalPrivacyControl
When true, treat sell/share as opted out for this site. When missing, use your normal privacy/consent flow.
LimitedNot Baseline
Google ChromeLimited / evolving — check current GPC support
Limited
Microsoft EdgeLimited — check current Sec-GPC / GPC status
Limited
OperaLimited — check current compat
Limited
Mozilla FirefoxMay expose via settings/extensions — verify on target versions
Limited
Apple SafariCheck current WebKit / Safari GPC status
Limited
globalPrivacyControlLimited
Bottom line: Detect GPC, honor true as do-not-sell/share, and never rely on deprecated doNotTrack for new logic.
Wrap Up
Conclusion
navigator.globalPrivacyControl is the JS face of Global Privacy Control. Feature-detect it, treat true as do-not-sell/share, pair it with Sec-GPC on the server, and prefer it over deprecated doNotTrack.
Five things to remember about globalPrivacyControl
Experimental GPC Boolean — do not sell/share when true.
5
Core concepts
🔒01
Returns
boolean
Type
🚫02
true
No sell/share
Opt-out
📄03
false
Consent or unset
MDN
📡04
Header
Sec-GPC
HTTP
🔬05
Status
Experimental
Detect
❓ Frequently Asked Questions
It is a read-only Navigator property that returns a Boolean for the user’s Global Privacy Control (GPC) setting on the current site — whether they consent to selling or sharing personal information with third parties.
Yes. MDN marks it Experimental and not Baseline. Support is limited — always feature-detect before reading it.
MDN: true means the user explicitly does not consent to sell or share their data. false means they either grant consent or have not indicated a preference.
The property reflects the same preference as the Sec-GPC HTTP header, so servers and client scripts can see a consistent signal.
doNotTrack is deprecated/non-standard and was a weak cooperative “don’t track” signal. GPC is a modern “do not sell/share” preference aimed at privacy laws and site obligations — still experimental in browsers, but the intended successor mindset for DNT.
No. It is read-only. Users enable GPC in supporting browsers or extensions; your page only reads the Boolean.
Did you know?
MDN’s example comment talks about the preference in plain English, but the value itself is a real Boolean true/false — not the strings "true" / "false".