Pārlūkot izejas kodu

fix: scroll element to screenshot into center

Ahmad Kholid 2 gadi atpakaļ
vecāks
revīzija
65c1ee4ce4
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      src/content/blocksHandler/handlerTakeScreenshot.js

+ 4 - 1
src/content/blocksHandler/handlerTakeScreenshot.js

@@ -71,7 +71,10 @@ async function captureElement({ selector, tabId, options }) {
     throw error;
   }
 
-  element.scrollIntoView();
+  element.scrollIntoView({
+    block: 'center',
+    inline: 'center',
+  });
 
   await sleep(500);