diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-14 12:26:32 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-14 12:26:32 +0100 |
commit | effff24825e50bd525892375e18cdaeb627f5855 (patch) | |
tree | ecf75a7fb3d3255efdc8e0fc387cbf1df9c6757c | |
parent | f4cc93fc9ee9059c44bb9bc28266b01397ede4a3 (diff) | |
download | uxp-effff24825e50bd525892375e18cdaeb627f5855.tar.gz |
Issue #1289 - Part 4: Update Pale Moon UI.
This swaps the UI choice to using the new boolean pref instead of
enforcement level.
-rw-r--r-- | application/palemoon/components/nsBrowserGlue.js | 7 | ||||
-rw-r--r-- | application/palemoon/components/preferences/security.js | 27 | ||||
-rw-r--r-- | application/palemoon/components/preferences/security.xul | 8 |
3 files changed, 10 insertions, 32 deletions
diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 01a133833d..31a8bf40c6 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1198,7 +1198,7 @@ BrowserGlue.prototype = { }, _migrateUI: function BG__migrateUI() { - const UI_VERSION = 19; + const UI_VERSION = 20; const BROWSER_DOCURL = "chrome://browser/content/browser.xul#"; let currentUIVersion = 0; try { @@ -1433,6 +1433,11 @@ BrowserGlue.prototype = { } #endif + if (currentUIVersion < 20) { + // HPKP change of UI preference; reset enforcement level + Services.prefs.clearUserPref("security.cert_pinning.enforcement_level"); + } + // Update the migration version. Services.prefs.setIntPref("browser.migration.version", UI_VERSION); }, diff --git a/application/palemoon/components/preferences/security.js b/application/palemoon/components/preferences/security.js index 9d5f302a21..54fab68ac1 100644 --- a/application/palemoon/components/preferences/security.js +++ b/application/palemoon/components/preferences/security.js @@ -18,7 +18,6 @@ var gSecurityPane = { { this._pane = document.getElementById("paneSecurity"); this._initMasterPasswordUI(); - this._initHPKPUI(); }, // ADD-ONS @@ -233,31 +232,5 @@ var gSecurityPane = { document.documentElement.openWindow("Toolkit:PasswordManager", "chrome://passwordmgr/content/passwordManager.xul", "", null); - }, - - _initHPKPUI: function() { - let checkbox = document.getElementById("enableHPKP"); - let HPKPpref = document.getElementById("security.cert_pinning.enforcement_level"); - - if (HPKPpref.value == 0) { - checkbox.checked = false; - } else { - checkbox.checked = true; - } - }, - - /** - * Updates the HPKP enforcement level to the proper value depending on checkbox - * state. - */ - updateHPKPPref: function() { - let checkbox = document.getElementById("enableHPKP"); - let HPKPpref = document.getElementById("security.cert_pinning.enforcement_level"); - - if (checkbox.checked) { - HPKPpref.value = 2; - } else { - HPKPpref.value = 0; - } } }; diff --git a/application/palemoon/components/preferences/security.xul b/application/palemoon/components/preferences/security.xul index bc16252751..9aa3f7a8af 100644 --- a/application/palemoon/components/preferences/security.xul +++ b/application/palemoon/components/preferences/security.xul @@ -46,9 +46,9 @@ <preference id="network.stricttransportsecurity.enabled" name="network.stricttransportsecurity.enabled" type="bool"/> - <preference id="security.cert_pinning.enforcement_level" - name="security.cert_pinning.enforcement_level" - type="int"/> + <preference id="security.cert_pinning.hpkp.enabled" + name="security.cert_pinning.hpkp.enabled" + type="bool"/> <!-- Opportunistic Encryption --> @@ -150,7 +150,7 @@ <checkbox id="enableHPKP" label="&enableHPKP.label;" accesskey="&enableHPKP.accesskey;" - oncommand="gSecurityPane.updateHPKPPref();"/> + preference="security.cert_pinning.hpkp.enabled"/> </vbox> </groupbox> |