From 6cd9aadfca048d0f42c5bf92b46a3bff835d7cfd Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 10 Apr 2021 11:18:01 +0200 Subject: [PATCH] fix screenshot scaling issue on firefox, https://github.com/zadam/trilium/issues/1202 --- background.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/background.js b/background.js index 6f0b055..5cacc39 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;