From 36176364740460cf321be1f28041a94d1d246acf Mon Sep 17 00:00:00 2001 From: fxbrit <34379516+fxbrit@users.noreply.github.com> Date: Wed, 30 Aug 2023 00:12:26 +0200 Subject: [PATCH] Added pref to revert RFP change (testing only) --- patches/rfp-spoof-dpr-to-2.patch | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/patches/rfp-spoof-dpr-to-2.patch b/patches/rfp-spoof-dpr-to-2.patch index b0404e0..636893a 100644 --- a/patches/rfp-spoof-dpr-to-2.patch +++ b/patches/rfp-spoof-dpr-to-2.patch @@ -1,3 +1,16 @@ +diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js +index 55ea93a..fe40ba6 100644 +--- a/browser/app/profile/firefox.js ++++ b/browser/app/profile/firefox.js +@@ -24,6 +24,8 @@ pref("librewolf.firefoxView.hideTabPickup", false); + pref("librewolf.firefoxView.hideColorways", true); + pref("librewolf.uBO.assetsBootstrapLocation", ""); + pref("librewolf.aboutMenu.checkVersion", false); ++pref("librewolf.testingOnly.overrideRfpDevicelPixelRatio", true); ++ + pref("browser.hiddenWindowChromeURL", "chrome://browser/content/hiddenWindowMac.xhtml"); + + // Enables some extra Extension System Logging (can reduce performance) diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index 3a97351..c15f9a4 100644 --- a/dom/base/nsGlobalWindowInner.cpp @@ -10,4 +23,18 @@ index 3a97351..c15f9a4 100644 + return 2.0; } } +diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp +index f81c908..b1299b4 100644 +--- a/dom/base/nsGlobalWindowInner.cpp ++++ b/dom/base/nsGlobalWindowInner.cpp +@@ -3504,6 +3504,9 @@ double nsGlobalWindowInner::GetDevicePixelRatio(CallerType aCallerType, + nsAutoCString origin; + nsresult rv = this->GetPrincipal()->GetOrigin(origin); + if (NS_FAILED(rv) || origin != "resource://pdf.js"_ns) { ++ if (Services.prefs.getBoolPref("librewolf.testingOnly.overrideRfpDevicelPixelRatio", false)) { ++ return 1.0; ++ } + return 2.0; + } + }