Explorar o código

fix: scroll element to screenshot into center

Ahmad Kholid %!s(int64=2) %!d(string=hai) anos
pai
achega
65c1ee4ce4
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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);