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

[tor-commits] [Git][tpo/applications/tor-browser][base-browser-102.15.0esr-12.5-1] Bug 42084: Ensure spoofing works even if preferences are set out of order.



Title: GitLab

ma1 pushed to branch base-browser-102.15.0esr-12.5-1 at The Tor Project / Applications / Tor Browser

Commits:

  • 60d54c03
    by hackademix at 2023-09-12T11:15:40+02:00
    Bug 42084: Ensure spoofing works even if preferences are set out of order.
    

1 changed file:

Changes:

  • toolkit/components/resistfingerprinting/RFPHelper.jsm
    ... ... @@ -163,6 +163,9 @@ class _RFPHelper {
    163 163
         // Add RFP and Letterboxing observers if prefs are enabled
    
    164 164
         this._handleResistFingerprintingChanged();
    
    165 165
         this._handleLetterboxingPrefChanged();
    
    166
    +
    
    167
    +    // Synchronize language preferences if accidentally messed up (tor-browser#42084)
    
    168
    +    this._handleSpoofEnglishChanged();
    
    166 169
       }
    
    167 170
     
    
    168 171
       uninit() {
    
    ... ... @@ -216,6 +219,7 @@ class _RFPHelper {
    216 219
             this._handleResistFingerprintingChanged();
    
    217 220
             break;
    
    218 221
           case kPrefSpoofEnglish:
    
    222
    +      case "intl.accept_languages":
    
    219 223
             this._handleSpoofEnglishChanged();
    
    220 224
             break;
    
    221 225
           case kPrefLetterboxing:
    
    ... ... @@ -264,6 +268,7 @@ class _RFPHelper {
    264 268
       }
    
    265 269
     
    
    266 270
       _handleSpoofEnglishChanged() {
    
    271
    +    Services.prefs.removeObserver("intl.accept_languages", this);
    
    267 272
         switch (Services.prefs.getIntPref(kPrefSpoofEnglish)) {
    
    268 273
           case 0: // will prompt
    
    269 274
           // This should only happen when turning privacy.resistFingerprinting off.
    
    ... ... @@ -282,6 +287,8 @@ class _RFPHelper {
    282 287
           case 2: // spoof
    
    283 288
             Services.prefs.setCharPref("intl.accept_languages", "en-US, en");
    
    284 289
             Services.prefs.setBoolPref("_javascript_.use_us_english_locale", true);
    
    290
    +        // Ensure spoofing works if preferences are set out of order
    
    291
    +        Services.prefs.addObserver("intl.accept_languages", this);
    
    285 292
             break;
    
    286 293
           default:
    
    287 294
             break;
    

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