0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 13:43:04 -05:00
LibreWolf/patches/rfp-spoof-dpr-to-2.patch

41 lines
1.7 KiB
Diff
Raw Normal View History

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
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -3616,7 +3616,7 @@ double nsGlobalWindowInner::GetDevicePixelRatio(CallerType aCallerType,
nsAutoCString origin;
nsresult rv = this->GetPrincipal()->GetOrigin(origin);
if (NS_FAILED(rv) || origin != "resource://pdf.js"_ns) {
- return 1.0;
+ 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;
}
}