From f1a54190bc2e940039e3a3e524a5c5531ec76e62 Mon Sep 17 00:00:00 2001 From: fxbrit <8320298-fxbrit@users.noreply.gitlab.com> Date: Sun, 30 Jul 2023 23:19:03 +0200 Subject: [PATCH] spoof DPR to 2 when RFP is in use The idea is to improve usability by reducing blurrines on some websites, even tho this increases memory usage. Ideally -moz-device-pixel-ratio should also be patched to match the value, but that is an issue regardless of DPR value so only tangential. --- assets/patches.txt | 1 + patches/rfp-spoof-dpr-to-2.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 patches/rfp-spoof-dpr-to-2.patch diff --git a/assets/patches.txt b/assets/patches.txt index afc2a6b..41bad67 100644 --- a/assets/patches.txt +++ b/assets/patches.txt @@ -12,6 +12,7 @@ patches/librewolf-prefs.patch patches/mozilla_dirs.patch patches/msix.patch patches/remove_addons.patch +patches/rfp-spoof-dpr-to-2.patch patches/sed-patches/allow-searchengines-non-esr.patch patches/sed-patches/disable-pocket.patch patches/sed-patches/stop-undesired-requests.patch diff --git a/patches/rfp-spoof-dpr-to-2.patch b/patches/rfp-spoof-dpr-to-2.patch new file mode 100644 index 0000000..b0404e0 --- /dev/null +++ b/patches/rfp-spoof-dpr-to-2.patch @@ -0,0 +1,13 @@ +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; + } + } +