Skip to content

Build your personal knowledge base with Trilium Notes

fix screenshot scaling issue on firefox, https://github.com/zadam/trilium/issues/1202

zadam6cd9aadfca04
diff --git a/background.js b/background.js
index 6f0b055871..5cacc39fee 100644
--- a/background.js
+++ b/background.js
@@ -37,12 +37,7 @@ function cropImage(newArea, dataUrl) {
async function takeScreenshot(cropRect) {
const activeTab = await getActiveTab();
-
- const isFirefox = typeof InstallTrigger !== 'undefined';
-
- // Chrome/blink do not incorporate automatically the devicePixelRatio so we need to do it manually
- const zoom = await browser.tabs.getZoom(activeTab.id)
- * (isFirefox ? 1 : window.devicePixelRatio);
+ const zoom = await browser.tabs.getZoom(activeTab.id) * window.devicePixelRatio;
const newArea = Object.assign({}, cropRect);
newArea.x *= zoom;