Skip to content

Commit ac80490

Browse files
committed
see pr: niklasvh#3097
Squashed commit of the following: commit d2d83ad Author: Joey Bloom <[email protected]> Date: Tue Jul 25 16:34:13 2023 -0500 Set the document clone iframe container's size via the style attribute This prevents CSS rules from overriding the iframe's size which would compromise the screenshot
1 parent 79a0924 commit ac80490

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dom/document-cloner.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ const createIFrameContainer = (ownerDocument: Document, bounds: Bounds): HTMLIFr
506506
cloneIframeContainer.style.border = '0';
507507
cloneIframeContainer.width = bounds.width.toString();
508508
cloneIframeContainer.height = bounds.height.toString();
509+
cloneIframeContainer.style.width = bounds.width.toString() + 'px';
510+
cloneIframeContainer.style.height = bounds.height.toString() + 'px';
509511
cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
510512
cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
511513
ownerDocument.body.appendChild(cloneIframeContainer);

0 commit comments

Comments
 (0)