summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2018-06-11 13:46:22 +0300
committerJustOff <Off.Just.Off@gmail.com>2018-06-11 13:46:22 +0300
commita250b46a0b6f7659bd14beef2b06f59c80e51e9c (patch)
tree5cf722e875d03f45631870652e3dd242345fc617 /application/palemoon/components
parent24f8b2fd5e2384a0e9f7a8f47005bd9c248f60be (diff)
downloadUXP-a250b46a0b6f7659bd14beef2b06f59c80e51e9c.tar
UXP-a250b46a0b6f7659bd14beef2b06f59c80e51e9c.tar.gz
UXP-a250b46a0b6f7659bd14beef2b06f59c80e51e9c.tar.lz
UXP-a250b46a0b6f7659bd14beef2b06f59c80e51e9c.tar.xz
UXP-a250b46a0b6f7659bd14beef2b06f59c80e51e9c.zip
[PALEMOON] Change the three-state DoNotTrack controls to a simple on/off switch
Diffstat (limited to 'application/palemoon/components')
-rw-r--r--application/palemoon/components/nsBrowserGlue.js16
-rw-r--r--application/palemoon/components/preferences/privacy.js36
-rw-r--r--application/palemoon/components/preferences/privacy.xul19
3 files changed, 20 insertions, 51 deletions
diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js
index aa24d88ef..5910ae9c0 100644
--- a/application/palemoon/components/nsBrowserGlue.js
+++ b/application/palemoon/components/nsBrowserGlue.js
@@ -1207,7 +1207,7 @@ BrowserGlue.prototype = {
},
_migrateUI: function BG__migrateUI() {
- const UI_VERSION = 17;
+ const UI_VERSION = 18;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
let currentUIVersion = 0;
try {
@@ -1412,6 +1412,20 @@ BrowserGlue.prototype = {
delete this._rdf;
delete this._dataSource;
+ if (currentUIVersion < 18) {
+ // Make sure the doNotTrack value conforms to the conversion from
+ // three-state to two-state. (This reverts a setting of "please track me"
+ // to the default "don't say anything").
+ try {
+ if (Services.prefs.getBoolPref("privacy.donottrackheader.enabled") &&
+ Services.prefs.getIntPref("privacy.donottrackheader.value") != 1) {
+ Services.prefs.clearUserPref("privacy.donottrackheader.enabled");
+ Services.prefs.clearUserPref("privacy.donottrackheader.value");
+ }
+ }
+ catch (ex) {}
+ }
+
// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},
diff --git a/application/palemoon/components/preferences/privacy.js b/application/palemoon/components/preferences/privacy.js
index 18e38395d..05c2f9b8a 100644
--- a/application/palemoon/components/preferences/privacy.js
+++ b/application/palemoon/components/preferences/privacy.js
@@ -151,42 +151,6 @@ var gPrivacyPane = {
},
/**
- * Update the Tracking preferences based on controls.
- */
- setTrackingPrefs: function PPP_setTrackingPrefs()
- {
- let dntRadioGroup = document.getElementById("doNotTrackSelection"),
- dntValuePref = document.getElementById("privacy.donottrackheader.value"),
- dntEnabledPref = document.getElementById("privacy.donottrackheader.enabled");
-
- // if the selected radio button says "no preference", set on/off pref to
- // false and don't change the value pref.
- if (dntRadioGroup.selectedItem.value == -1) {
- dntEnabledPref.value = false;
- return dntValuePref.value;
- }
-
- dntEnabledPref.value = true;
- return dntRadioGroup.selectedItem.value;
- },
-
- /**
- * Obtain the tracking preference value and reflect it in the UI.
- */
- getTrackingPrefs: function PPP_getTrackingPrefs()
- {
- let dntValuePref = document.getElementById("privacy.donottrackheader.value"),
- dntEnabledPref = document.getElementById("privacy.donottrackheader.enabled");
-
- // if DNT is enbaled, select the value from the selected radio
- // button, otherwise choose the "no preference" radio button
- if (dntEnabledPref.value)
- return dntValuePref.value;
-
- return document.getElementById("dntnopref").value;
- },
-
- /**
* Update the private browsing auto-start pref and the history mode
* micro-management prefs based on the history mode menulist
*/
diff --git a/application/palemoon/components/preferences/privacy.xul b/application/palemoon/components/preferences/privacy.xul
index 057d549a9..bdb227c63 100644
--- a/application/palemoon/components/preferences/privacy.xul
+++ b/application/palemoon/components/preferences/privacy.xul
@@ -30,9 +30,6 @@
<preference id="privacy.donottrackheader.enabled"
name="privacy.donottrackheader.enabled"
type="bool"/>
- <preference id="privacy.donottrackheader.value"
- name="privacy.donottrackheader.value"
- type="int"/>
<!-- XXX button prefs -->
<preference id="pref.privacy.disable_button.cookie_exceptions"
@@ -239,17 +236,11 @@
<!-- Tracking -->
<tabpanel id="trackingPanel" orient="vertical">
- <radiogroup id="doNotTrackSelection" orient="vertical"
- preference="privacy.donottrackheader.value"
- onsynctopreference="return gPrivacyPane.setTrackingPrefs()"
- onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()">
- <radio id="dntnotrack" value="1" label="&dntTrackingNotOkay.label2;"
- accesskey="&dntTrackingNotOkay.accesskey;" />
- <radio id="dntdotrack" value="0" label="&dntTrackingOkay.label2;"
- accesskey="&dntTrackingOkay.accesskey;" />
- <radio id="dntnopref" value="-1" label="&dntTrackingNopref.label2;"
- accesskey="&dntTrackingNopref.accesskey;" />
- </radiogroup>
+ <checkbox id="privacyDoNotTrackCheckbox"
+ label="&dntTrackingNotOkay.label2;"
+ accesskey="&dntTrackingNotOkay.accesskey;"
+ preference="privacy.donottrackheader.enabled"/>
+ <separator class="thin"/>
<label class="text-link" id="doNotTrackInfo"
href="https://www.mozilla.org/dnt"
value="&doNotTrackInfo.label;"/>