Lightpanda: the headless browser designed for AI and automation
webapi: default navigator.globalPrivacyControl to false
Navid EMAD66bbce21e0f9
diff --git a/src/browser/tests/navigator/navigator.html b/src/browser/tests/navigator/navigator.htmlindex 10ed2bcc4..4aaca8087 100644--- a/src/browser/tests/navigator/navigator.html+++ b/src/browser/tests/navigator/navigator.html@@ -30,6 +30,12 @@testing.expectEqual(null, navigator.doNotTrack);+ // GPC must default to false — per https://w3c.github.io/gpc/#javascript-property+ // the signal reflects an explicit user preference (Firefox defaults to false;+ // Chrome doesn't expose the property at all). A true default makes+ // GPC-compliant consent managers reject-all and skip their consent UI.+ testing.expectEqual(false, navigator.globalPrivacyControl);+// Every Navigator attribute must be a native accessor on the prototypefor (const name of ['userAgent', 'appName', 'appCodeName', 'appVersion', 'platform',diff --git a/src/browser/webapi/Navigator.zig b/src/browser/webapi/Navigator.zigindex a895a8f61..1ffd6af2d 100644--- a/src/browser/webapi/Navigator.zig+++ b/src/browser/webapi/Navigator.zig@@ -97,8 +97,13 @@ pub fn getWebdriver(_: *const Navigator) bool {return false;}+// Default to false: per https://w3c.github.io/gpc/#javascript-property the+// signal reflects an explicit user preference, and none is configured here.+// Firefox defaults to false; Chrome doesn't expose the property. Returning+// true made GPC-compliant consent managers treat every page load as "reject+// tracking" and skip their consent UI entirely.pub fn getGlobalPrivacyControl(_: *const Navigator) bool {- return true;+ return false;}pub fn getPlatform(_: *const Navigator) []const u8 {