Verified Commit 52bbd105 authored by Fatih's avatar Fatih Committed by Pier Angelo Vendrame
Browse files

Bug 1830629: Remove unnecessary checks for pdf.js for RFP. r=tjr

resource:// is exempt from RFP, so we no longer need to check pdf.js specifically.

Differential Revision: https://phabricator.services.mozilla.com/D209359
parent 47d6d759
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -3604,20 +3604,9 @@ double nsGlobalWindowInner::GetDevicePixelRatio(CallerType aCallerType,
    return 1.0;
  }

  if (nsIGlobalObject::ShouldResistFingerprinting(aCallerType,
                                                  RFPTarget::Unknown)) {
    // Spoofing the DevicePixelRatio causes blurriness in some situations
    // on HiDPI displays. pdf.js is a non-system caller; but it can't
    // expose the fingerprintable information, so we can safely disable
    // spoofing in this situation. It doesn't address the issue for
    // web-rendered content (including pdf.js instances on the web.)
    // In the future we hope to have a better solution to fix all HiDPI
    // blurriness...
    nsAutoCString origin;
    nsresult rv = this->GetPrincipal()->GetOrigin(origin);
    if (NS_FAILED(rv) || origin != "resource://pdf.js"_ns) {
      return 1.0;
    }
  if (nsIGlobalObject::ShouldResistFingerprinting(
          aCallerType, RFPTarget::Unknown)) {
    return 2.0;
  }

  if (aCallerType == CallerType::NonSystem) {