[tbb-commits] [tor-browser] 01/03: fixup! Bug 40925: Implemented the Security Level component

gitolite role git at cupani.torproject.org
Tue Dec 6 11:43:36 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch tor-browser-102.5.0esr-12.5-1
in repository tor-browser.

commit d2b71fb57d52f9ca5f3e8d351a786fe154c3e9c0
Author: Henry Wilkes <henry at torproject.org>
AuthorDate: Fri Nov 18 14:52:41 2022 +0000

    fixup! Bug 40925: Implemented the Security Level component
    
    Clean up some unnecessary imports and use var instead of const for
    exported variables.
---
 .../securitylevel/content/securityLevel.js         | 38 +++++-----------------
 1 file changed, 8 insertions(+), 30 deletions(-)

diff --git a/browser/components/securitylevel/content/securityLevel.js b/browser/components/securitylevel/content/securityLevel.js
index 2ef7fc1648df..ee84c9d342a2 100644
--- a/browser/components/securitylevel/content/securityLevel.js
+++ b/browser/components/securitylevel/content/securityLevel.js
@@ -2,15 +2,11 @@
 
 /* global AppConstants, Services, openPreferences, XPCOMUtils */
 
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
 XPCOMUtils.defineLazyModuleGetters(this, {
-  CustomizableUI: "resource:///modules/CustomizableUI.jsm",
   PanelMultiView: "resource:///modules/PanelMultiView.jsm",
 });
 
-const SecurityLevels = Object.freeze(["", "safest", "safer", "", "standard"]);
+var SecurityLevels = Object.freeze(["", "safest", "safer", "", "standard"]);
 
 XPCOMUtils.defineLazyGetter(this, "SecurityLevelStrings", () => {
   let strings = {
@@ -75,7 +71,7 @@ XPCOMUtils.defineLazyGetter(this, "SecurityLevelStrings", () => {
 
   Getters and Setters for relevant torbutton prefs
 */
-const SecurityLevelPrefs = {
+var SecurityLevelPrefs = {
   security_slider_pref: "browser.security_level.security_slider",
   security_custom_pref: "browser.security_level.security_custom",
 
@@ -124,7 +120,7 @@ const SecurityLevelPrefs = {
   Controls init and update of the security level toolbar button
 */
 
-const SecurityLevelButton = {
+var SecurityLevelButton = {
   _securityPrefsBranch: null,
 
   _configUIFromPrefs() {
@@ -231,7 +227,7 @@ const SecurityLevelButton = {
     SecurityLevelPanel.show();
     aEvent.stopPropagation();
   },
-}; /* Security Level Button */
+}; /* SecurityLevelButton */
 
 /*
   Security Level Panel Code
@@ -239,7 +235,7 @@ const SecurityLevelButton = {
   Controls init and update of the panel in the security level hanger
 */
 
-const SecurityLevelPanel = {
+var SecurityLevelPanel = {
   _securityPrefsBranch: null,
   _panel: null,
   _anchor: null,
@@ -405,7 +401,7 @@ const SecurityLevelPanel = {
   onPopupHidden(event) {
     SecurityLevelButton.button.removeAttribute("open");
   },
-}; /* Security Level Panel */
+}; /* SecurityLevelPanel */
 
 /*
   Security Level Preferences Code
@@ -413,7 +409,7 @@ const SecurityLevelPanel = {
   Code to handle init and update of security level section in about:preferences#privacy
 */
 
-const SecurityLevelPreferences = {
+var SecurityLevelPreferences = {
   _securityPrefsBranch: null,
 
   _populateXUL() {
@@ -590,22 +586,4 @@ const SecurityLevelPreferences = {
   restoreDefaults() {
     SecurityLevelPrefs.securityCustom = false;
   },
-}; /* Security Level Prefereces */
-
-Object.defineProperty(this, "SecurityLevelButton", {
-  value: SecurityLevelButton,
-  enumerable: true,
-  writable: false,
-});
-
-Object.defineProperty(this, "SecurityLevelPanel", {
-  value: SecurityLevelPanel,
-  enumerable: true,
-  writable: false,
-});
-
-Object.defineProperty(this, "SecurityLevelPreferences", {
-  value: SecurityLevelPreferences,
-  enumerable: true,
-  writable: false,
-});
+}; /* SecurityLevelPreferences */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list