| ... |
... |
@@ -415,11 +415,7 @@ const CookieBannerExecutedRecordCleaner = { |
|
415
|
415
|
|
|
416
|
416
|
// A cleaner for cleaning fingerprinting protection states.
|
|
417
|
417
|
const FingerprintingProtectionStateCleaner = {
|
|
418
|
|
- async _maybeClearSiteSpecificZoom(
|
|
419
|
|
- deleteAll,
|
|
420
|
|
- aSchemelessSite,
|
|
421
|
|
- aOriginAttributes = {}
|
|
422
|
|
- ) {
|
|
|
418
|
+ async _maybeClearSiteSpecificZoom(aSchemelessSite, aOriginAttributes = {}) {
|
|
423
|
419
|
if (
|
|
424
|
420
|
!ChromeUtils.shouldResistFingerprinting("SiteSpecificZoom", null, true)
|
|
425
|
421
|
) {
|
| ... |
... |
@@ -432,8 +428,24 @@ const FingerprintingProtectionStateCleaner = { |
|
432
|
428
|
const ZOOM_PREF_NAME = "browser.content.full-zoom";
|
|
433
|
429
|
|
|
434
|
430
|
await new Promise((aResolve, aReject) => {
|
|
435
|
|
- if (deleteAll) {
|
|
436
|
|
- cps2.removeByName(ZOOM_PREF_NAME, null, {
|
|
|
431
|
+ aOriginAttributes =
|
|
|
432
|
+ ChromeUtils.fillNonDefaultOriginAttributes(aOriginAttributes);
|
|
|
433
|
+
|
|
|
434
|
+ let loadContext;
|
|
|
435
|
+ if (
|
|
|
436
|
+ aOriginAttributes.privateBrowsingId ==
|
|
|
437
|
+ Services.scriptSecurityManager.DEFAULT_PRIVATE_BROWSING_ID
|
|
|
438
|
+ ) {
|
|
|
439
|
+ loadContext = Cu.createLoadContext();
|
|
|
440
|
+ } else {
|
|
|
441
|
+ loadContext = Cu.createPrivateLoadContext();
|
|
|
442
|
+ }
|
|
|
443
|
+
|
|
|
444
|
+ cps2.removeBySubdomainAndName(
|
|
|
445
|
+ aSchemelessSite,
|
|
|
446
|
+ ZOOM_PREF_NAME,
|
|
|
447
|
+ loadContext,
|
|
|
448
|
+ {
|
|
437
|
449
|
handleCompletion: aReason => {
|
|
438
|
450
|
if (aReason === cps2.COMPLETE_ERROR) {
|
|
439
|
451
|
aReject();
|
| ... |
... |
@@ -441,50 +453,19 @@ const FingerprintingProtectionStateCleaner = { |
|
441
|
453
|
aResolve();
|
|
442
|
454
|
}
|
|
443
|
455
|
},
|
|
444
|
|
- });
|
|
445
|
|
- } else {
|
|
446
|
|
- aOriginAttributes =
|
|
447
|
|
- ChromeUtils.fillNonDefaultOriginAttributes(aOriginAttributes);
|
|
448
|
|
-
|
|
449
|
|
- let loadContext;
|
|
450
|
|
- if (
|
|
451
|
|
- aOriginAttributes.privateBrowsingId ==
|
|
452
|
|
- Services.scriptSecurityManager.DEFAULT_PRIVATE_BROWSING_ID
|
|
453
|
|
- ) {
|
|
454
|
|
- loadContext = Cu.createLoadContext();
|
|
455
|
|
- } else {
|
|
456
|
|
- loadContext = Cu.createPrivateLoadContext();
|
|
457
|
456
|
}
|
|
458
|
|
-
|
|
459
|
|
- cps2.removeBySubdomainAndName(
|
|
460
|
|
- aSchemelessSite,
|
|
461
|
|
- ZOOM_PREF_NAME,
|
|
462
|
|
- loadContext,
|
|
463
|
|
- {
|
|
464
|
|
- handleCompletion: aReason => {
|
|
465
|
|
- if (aReason === cps2.COMPLETE_ERROR) {
|
|
466
|
|
- aReject();
|
|
467
|
|
- } else {
|
|
468
|
|
- aResolve();
|
|
469
|
|
- }
|
|
470
|
|
- },
|
|
471
|
|
- }
|
|
472
|
|
- );
|
|
473
|
|
- }
|
|
|
457
|
+ );
|
|
474
|
458
|
});
|
|
475
|
459
|
},
|
|
476
|
460
|
|
|
477
|
461
|
async deleteAll() {
|
|
478
|
462
|
Services.rfp.cleanAllRandomKeys();
|
|
479
|
|
-
|
|
480
|
|
- await this._maybeClearSiteSpecificZoom(true);
|
|
481
|
463
|
},
|
|
482
|
464
|
|
|
483
|
465
|
async deleteByPrincipal(aPrincipal) {
|
|
484
|
466
|
Services.rfp.cleanRandomKeyByPrincipal(aPrincipal);
|
|
485
|
467
|
|
|
486
|
468
|
await this._maybeClearSiteSpecificZoom(
|
|
487
|
|
- false,
|
|
488
|
469
|
aPrincipal.host,
|
|
489
|
470
|
aPrincipal.originAttributes
|
|
490
|
471
|
);
|
| ... |
... |
@@ -497,7 +478,6 @@ const FingerprintingProtectionStateCleaner = { |
|
497
|
478
|
);
|
|
498
|
479
|
|
|
499
|
480
|
await this._maybeClearSiteSpecificZoom(
|
|
500
|
|
- false,
|
|
501
|
481
|
aSchemelessSite,
|
|
502
|
482
|
aOriginAttributesPattern
|
|
503
|
483
|
);
|
| ... |
... |
@@ -509,11 +489,7 @@ const FingerprintingProtectionStateCleaner = { |
|
509
|
489
|
JSON.stringify(aOriginAttributesPattern)
|
|
510
|
490
|
);
|
|
511
|
491
|
|
|
512
|
|
- await this._maybeClearSiteSpecificZoom(
|
|
513
|
|
- false,
|
|
514
|
|
- aHost,
|
|
515
|
|
- aOriginAttributesPattern
|
|
516
|
|
- );
|
|
|
492
|
+ await this._maybeClearSiteSpecificZoom(aHost, aOriginAttributesPattern);
|
|
517
|
493
|
},
|
|
518
|
494
|
|
|
519
|
495
|
async deleteByOriginAttributes(aOriginAttributesString) {
|