mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-05 23:07:31 +09:00
[PALEMOON] Change the three-state DoNotTrack controls to a simple on/off switch
This commit is contained in:
parent
38dac3dae0
commit
c1f85b85de
5 changed files with 20 additions and 56 deletions
|
|
@ -150,42 +150,6 @@ var gPrivacyPane = {
|
|||
document.getElementById("historyPane").selectedIndex = selectedIndex;
|
||||
},
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -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;"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue