Pier Angelo Vendrame pushed to branch tor-browser-153.0esr-16.0-1 at The Tor Project / Applications / Tor Browser

Commits:

1 changed file:

Changes:

  • toolkit/components/securitylevel/SecurityLevel.sys.mjs
    ... ... @@ -336,14 +336,22 @@ var read_setting_from_prefs = function (prefNames) {
    336 336
         // For the given settingIndex, check if all current pref values
    
    337 337
         // match the setting.
    
    338 338
         for (const prefName of prefNames) {
    
    339
    -      const wanted = kSecuritySettings[prefName][settingIndex];
    
    340
    -      const actual = Services.prefs.getBoolPref(prefName);
    
    341
    -      if (wanted !== actual) {
    
    342
    -        possibleSetting = false;
    
    343
    -        logger.debug(
    
    344
    -          `${prefName} does not match level ${settingIndex}: ${actual}, should be ${wanted}!`
    
    345
    -        );
    
    346
    -        break;
    
    339
    +      try {
    
    340
    +        const wanted = kSecuritySettings[prefName][settingIndex];
    
    341
    +        const actual = Services.prefs.getBoolPref(prefName);
    
    342
    +        if (wanted !== actual) {
    
    343
    +          possibleSetting = false;
    
    344
    +          logger.debug(
    
    345
    +            `${prefName} does not match level ${settingIndex}: ${actual}, should be ${wanted}!`
    
    346
    +          );
    
    347
    +          break;
    
    348
    +        }
    
    349
    +      } catch (e) {
    
    350
    +        // All the relevant prefs must have a defined default.
    
    351
    +        // If we get here, a preference might have been dropped upstream,
    
    352
    +        // therefore it makes sense to ignore it to determine the security
    
    353
    +        // level, but warn so that we have a look at what went wrong.
    
    354
    +        logger.warn(`Cannot get the value for ${prefName}`, e);
    
    347 355
           }
    
    348 356
         }
    
    349 357
         if (possibleSetting) {