Skip to content

Commit

Permalink
see pr: niklasvh#3097
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit d2d83ad
Author: Joey Bloom <15joeybloom@gmail.com>
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
  • Loading branch information
nangelina committed Feb 9, 2024
1 parent 79a0924 commit ac80490
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dom/document-cloner.ts
Expand Up @@ -506,6 +506,8 @@ const createIFrameContainer = (ownerDocument: Document, bounds: Bounds): HTMLIFr
cloneIframeContainer.style.border = '0';
cloneIframeContainer.width = bounds.width.toString();
cloneIframeContainer.height = bounds.height.toString();
cloneIframeContainer.style.width = bounds.width.toString() + 'px';
cloneIframeContainer.style.height = bounds.height.toString() + 'px';
cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it
cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');
ownerDocument.body.appendChild(cloneIframeContainer);
Expand Down

0 comments on commit ac80490

Please sign in to comment.