[Basilisk] Issue #19 - Implement GlobalPrivacyControl

This commit is contained in:
Basilisk-Dev 2022-08-10 18:15:18 -04:00 committed by roytam1
commit 30e47eb5bc
5 changed files with 30 additions and 20 deletions

View file

@ -987,6 +987,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);

View file

@ -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);
},

View file

@ -9,9 +9,9 @@
<preferences id="privacyPreferences" hidden="true" data-category="panePrivacy">
<!-- Tracking -->
<preference id="privacy.donottrackheader.enabled"
name="privacy.donottrackheader.enabled"
<!-- Global Privacy Control -->
<preference id="privacy.GPCheader.enabled"
name="privacy.GPCheader.enabled"
type="bool"/>
<!-- XXX button prefs -->
@ -80,18 +80,18 @@
<html:a class="help-button" target="_blank" aria-label="&helpButton.label;"></html:a>
</hbox>
<!-- Tracking -->
<groupbox id="trackingGroup" data-category="panePrivacy" hidden="true">
<vbox id="donottrackbox">
<caption><label>&tracking.label;</label></caption>
<!-- Global Privacy Control -->
<groupbox id="dataPrivacyGroup" data-category="panePrivacy" hidden="true">
<vbox id="privacygpcbox">
<caption><label>&dataPrivacy.label;</label></caption>
<hbox align="center">
<checkbox id="DoNotTrack"
preference="privacy.donottrackheader.enabled"
accesskey="&doNotTrack.accesskey;"
label="&doNotTrack.label;" />
<checkbox id="GPC"
preference="privacy.GPCheader.enabled"
accesskey="&GPC.accesskey;"
label="&GPCLabel.label;" />
<label class="text-link"
value="&doNotTrackLearnMore.label;"
href="https://www.mozilla.org/dnt"/>
value="&GPCLearnMore.label;"
href="https://www.palemoon.org/support/global-privacy-control"/>
</hbox>
</vbox>
</groupbox>

View file

@ -2,10 +2,10 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY tracking.label "Tracking">
<!ENTITY doNotTrack.label "Send a signal that you dont want to be tracked">
<!ENTITY doNotTrack.accesskey "T">
<!ENTITY doNotTrackLearnMore.label "Learn More">
<!ENTITY dataPrivacy.label "Data Privacy">
<!ENTITY GPCLabel.label "Tell sites not to share or sell my data">
<!ENTITY GPC.accesskey "n">
<!ENTITY GPCLearnMore.label "Learn More">
<!ENTITY history.label "History">

View file

@ -236,13 +236,13 @@ treecol {
/* Privacy pane */
.doNotTrackLearnMore {
.GPCLearnMore {
margin-inline-start: calc(1em + 30px);
margin-bottom: 1em;
font-weight: normal;
}
.doNotTrackLearnMore > label {
.GPCLearnMore > label {
font-size: 1em !important;
margin-left: 0;
}