[Pale-Moon] Issue MoonchildProductions/UXP#1721 - Implement GlobalPrivacyControl

Front-end and locale changes for GPC in preferences as well as migration.
Also bumps the back-end pointer to pick up the platform changes necessary.
This commit is contained in:
Moonchild 2021-10-07 23:20:53 +00:00 • committed by roytam1
commit 591a887bf3
3 changed files with 26 additions and 18 deletions

View file

@ -1284,7 +1284,7 @@ BrowserGlue.prototype = {
}, },
_migrateUI: function() { _migrateUI: function() {
const UI_VERSION = 24; const UI_VERSION = 26;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#"; const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
let currentUIVersion = 0; let currentUIVersion = 0;
try { try {
@ -1558,6 +1558,14 @@ BrowserGlue.prototype = {
Services.prefs.clearUserPref("dom.abortController.enabled"); Services.prefs.clearUserPref("dom.abortController.enabled");
} }
if (currentUIVersion < 26) {
// 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");
}
}
// Clear out dirty storage // Clear out dirty storage
if (this._dirty) { if (this._dirty) {

View file

@ -22,9 +22,9 @@
<preferences id="privacyPreferences"> <preferences id="privacyPreferences">
<!-- Tracking --> <!-- Global Privacy Control -->
<preference id="privacy.donottrackheader.enabled" <preference id="privacy.GPCheader.enabled"
name="privacy.donottrackheader.enabled" name="privacy.GPCheader.enabled"
type="bool"/> type="bool"/>
<!-- XXX button prefs --> <!-- XXX button prefs -->
@ -216,18 +216,18 @@
</groupbox> </groupbox>
<!-- Tracking --> <!-- Global Privacy Control -->
<groupbox id="trackingPanel"> <groupbox id="dataPrivacyPanel">
<caption>&tracking.label;</caption> <caption>&dataPrivacy.label;</caption>
<hbox align="center"> <hbox align="center">
<checkbox id="privacyDoNotTrackCheckbox" <checkbox id="privacyGPCCheckbox"
label="&dntTrackingNotOkay.label2;" label="&sendGPCheader.label;"
accesskey="&dntTrackingNotOkay.accesskey;" accesskey="&sendGPCheader.accesskey;"
preference="privacy.donottrackheader.enabled"/> preference="privacy.GPCheader.enabled"/>
<separator class="thin"/> <separator class="thin"/>
<label class="text-link" id="doNotTrackInfo" <label class="text-link" id="GPCInfo"
href="https://www.palemoon.org/support/do-not-track" href="https://www.palemoon.org/support/global-privacy-control"
value="&doNotTrackInfo.label;"/> value="&GPCInfo.label;"/>
</hbox> </hbox>
</groupbox> </groupbox>

View file

@ -2,11 +2,11 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this - 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/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY tracking.label "Tracking"> <!ENTITY dataPrivacy.label "Data Privacy">
<!ENTITY dntTrackingNotOkay.label2 "Tell sites that I do not want to be tracked"> <!ENTITY sendGPCheader.label "Tell sites not to share or sell my data">
<!ENTITY dntTrackingNotOkay.accesskey "n"> <!ENTITY sendGPCheader.accesskey "n">
<!ENTITY doNotTrackInfo.label "Learn More"> <!ENTITY GPCInfo.label "Learn More">
<!ENTITY history.label "History"> <!ENTITY history.label "History">