From 3a0d604470b0fa826a71f4eadd4f5265a220a1a2 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Wed, 10 Aug 2022 18:15:18 -0400 Subject: Issue #19 - Implement GlobalPrivacyControl --- basilisk/app/profile/basilisk.js | 1 + basilisk/components/nsBrowserGlue.js | 11 ++++++++- .../components/preferences/in-content/privacy.xul | 26 +++++++++++----------- .../en-US/chrome/browser/preferences/privacy.dtd | 8 +++---- .../shared/incontentprefs/preferences.inc.css | 4 ++-- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/basilisk/app/profile/basilisk.js b/basilisk/app/profile/basilisk.js index 538ecf8..2304aa5 100644 --- a/basilisk/app/profile/basilisk.js +++ b/basilisk/app/profile/basilisk.js @@ -986,6 +986,7 @@ pref("services.sync.prefs.sync.privacy.clearOnShutdown.offlineApps", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.sessions", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.siteSettings", true); pref("services.sync.prefs.sync.privacy.donottrackheader.enabled", true); +pref("services.sync.prefs.sync.privacy.GPCheader.enabled", true); pref("services.sync.prefs.sync.privacy.sanitize.sanitizeOnShutdown", true); pref("services.sync.prefs.sync.security.OCSP.enabled", true); pref("services.sync.prefs.sync.security.OCSP.require", true); diff --git a/basilisk/components/nsBrowserGlue.js b/basilisk/components/nsBrowserGlue.js index 2b2daeb..516cab0 100644 --- a/basilisk/components/nsBrowserGlue.js +++ b/basilisk/components/nsBrowserGlue.js @@ -1524,7 +1524,7 @@ BrowserGlue.prototype = { }, _migrateUI: function() { - const UI_VERSION = 43; + const UI_VERSION = 44; const BROWSER_DOCURL = "chrome://browser/content/browser.xul"; let currentUIVersion; @@ -1858,6 +1858,15 @@ BrowserGlue.prototype = { Services.prefs.clearUserPref("layers.acceleration.force-enabled"); } + if (currentUIVersion < 44) { + // DoNotTrack is now GPC. Carry across user preference. + if (Services.prefs.prefHasUserValue("privacy.donottrackheader.enabled")) { + let DNTEnabled = Services.prefs.getBoolPref("privacy.donottrackheader.enabled"); + Services.prefs.setBoolPref("privacy.GPCheader.enabled", DNTEnabled); + Services.prefs.clearUserPref("privacy.donottrackheader.enabled"); + } + } + // Update the migration version. Services.prefs.setIntPref("browser.migration.version", UI_VERSION); }, diff --git a/basilisk/components/preferences/in-content/privacy.xul b/basilisk/components/preferences/in-content/privacy.xul index 917e2e6..a9d256e 100644 --- a/basilisk/components/preferences/in-content/privacy.xul +++ b/basilisk/components/preferences/in-content/privacy.xul @@ -9,9 +9,9 @@