[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/mullvad-browser][mullvad-browser-115.9.0esr-13.5-1] fixup! Bug 40925: Implemented the Security Level component



Title: GitLab

Pier Angelo Vendrame pushed to branch mullvad-browser-115.9.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser

Commits:

  • a6c43d7e
    by Pier Angelo Vendrame at 2024-03-27T14:34:53+01:00
    fixup! Bug 40925: Implemented the Security Level component
    
    Bug 42481: Modularize SecurityLevel.
    

5 changed files:

Changes:

  • browser/components/securitylevel/content/securityLevel.js
    ... ... @@ -2,11 +2,9 @@
    2 2
     
    
    3 3
     /* global AppConstants, Services, openPreferences, XPCOMUtils */
    
    4 4
     
    
    5
    -ChromeUtils.defineModuleGetter(
    
    6
    -  this,
    
    7
    -  "SecurityLevelPrefs",
    
    8
    -  "resource://gre/modules/SecurityLevel.jsm"
    
    9
    -);
    
    5
    +ChromeUtils.defineESModuleGetters(this, {
    
    6
    +  SecurityLevelPrefs: "resource://gre/modules/SecurityLevel.sys.mjs",
    
    7
    +});
    
    10 8
     
    
    11 9
     /*
    
    12 10
       Security Level Button Code
    

  • toolkit/components/search/SearchEngine.sys.mjs
    ... ... @@ -12,14 +12,9 @@ const lazy = {};
    12 12
     ChromeUtils.defineESModuleGetters(lazy, {
    
    13 13
       NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
    
    14 14
       SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
    
    15
    +  SecurityLevelPrefs: "resource://gre/modules/SecurityLevel.sys.mjs",
    
    15 16
     });
    
    16 17
     
    
    17
    -ChromeUtils.defineModuleGetter(
    
    18
    -  lazy,
    
    19
    -  "SecurityLevelPrefs",
    
    20
    -  "resource://gre/modules/SecurityLevel.jsm"
    
    21
    -);
    
    22
    -
    
    23 18
     const BinaryInputStream = Components.Constructor(
    
    24 19
       "@mozilla.org/binaryinputstream;1",
    
    25 20
       "nsIBinaryInputStream",
    

  • toolkit/components/securitylevel/SecurityLevel.jsmtoolkit/components/securitylevel/SecurityLevel.sys.mjs
    1
    -"use strict";
    
    2
    -
    
    3
    -var EXPORTED_SYMBOLS = ["SecurityLevel", "SecurityLevelPrefs"];
    
    4
    -
    
    5
    -const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
    
    6
    -const { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
    
    1
    +import { ConsoleAPI } from "resource://gre/modules/Console.sys.mjs";
    
    7 2
     
    
    8 3
     const lazy = {};
    
    9 4
     
    
    10
    -ChromeUtils.defineModuleGetter(
    
    11
    -  lazy,
    
    12
    -  "ExtensionParent",
    
    13
    -  "resource://gre/modules/ExtensionParent.jsm"
    
    14
    -);
    
    5
    +ChromeUtils.defineESModuleGetters(lazy, {
    
    6
    +  ExtensionParent: "resource://gre/modules/ExtensionParent.sys.mjs",
    
    7
    +});
    
    15 8
     
    
    16 9
     const logger = new ConsoleAPI({
    
    17 10
       maxLogLevel: "info",
    
    ... ... @@ -275,6 +268,7 @@ var initializeNoScriptControl = () => {
    275 268
     // bind NoScript settings to the browser.security_level.security_slider
    
    276 269
     // (see noscript-control.js).
    
    277 270
     /* eslint-disable */
    
    271
    +// prettier-ignore
    
    278 272
     const kSecuritySettings = {
    
    279 273
       // Preference name :                                          [0, 1-high 2-m    3-m    4-low]
    
    280 274
       "_javascript_.options.ion" :                                    [,  false, false, false, true ],
    
    ... ... @@ -439,7 +433,7 @@ function migratePreferences() {
    439 433
     }
    
    440 434
     
    
    441 435
     // This class is used to initialize the security level stuff at the startup
    
    442
    -class SecurityLevel {
    
    436
    +export class SecurityLevel {
    
    443 437
       QueryInterface = ChromeUtils.generateQI(["nsIObserver"]);
    
    444 438
     
    
    445 439
       init() {
    
    ... ... @@ -460,7 +454,7 @@ class SecurityLevel {
    460 454
     
    
    461 455
       Getters and Setters for relevant torbutton prefs
    
    462 456
     */
    
    463
    -const SecurityLevelPrefs = {
    
    457
    +export const SecurityLevelPrefs = {
    
    464 458
       SecurityLevels: Object.freeze({
    
    465 459
         safest: 1,
    
    466 460
         safer: 2,
    

  • toolkit/components/securitylevel/components.conf
    ... ... @@ -4,7 +4,7 @@ Classes = [
    4 4
             "contract_ids": [
    
    5 5
                 "@torproject.org/security-level;1",
    
    6 6
             ],
    
    7
    -        "jsm": "resource://gre/modules/SecurityLevel.jsm",
    
    7
    +        "esModule": "resource://gre/modules/SecurityLevel.sys.mjs",
    
    8 8
             "constructor": "SecurityLevel",
    
    9 9
         }
    
    10 10
     ]

  • toolkit/components/securitylevel/moz.build
    1 1
     EXTRA_JS_MODULES += [
    
    2
    -    "SecurityLevel.jsm",
    
    2
    +    "SecurityLevel.sys.mjs",
    
    3 3
     ]
    
    4 4
     
    
    5 5
     XPCOM_MANIFESTS += [
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits