Skip to content

Commit

Permalink
Update waitForCapture to hide scrollbars on Windows (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
derekblank committed May 15, 2024
1 parent 63f8957 commit 1f4b113
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/screenshot-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ export function createScreenshotWindow( captureUrl: string ) {

const waitForCapture = async () => {
await finishedLoading;
await window.webContents.insertCSS( '::-webkit-scrollbar { display: none; }' );
await window.webContents.insertCSS( `
body {
overflow: hidden;
height: 100vh;
}
::-webkit-scrollbar {
display: none;
}
` );

await new Promise( ( resolve ) => setTimeout( resolve, 500 ) );
return window.webContents.capturePage();
};
Expand Down

0 comments on commit 1f4b113

Please sign in to comment.