Skip to content

Add ability to set a node where to create the Iframe container. #130

@sanex3339

Description

@sanex3339

Right now the code look like this:
https://github.com/yorickshan/html2canvas-pro/blob/main/src/dom/document-cloner.ts#L526

    ownerDocument.body.appendChild(cloneIframeContainer);

The issue with this approach is that sometimes when the shadow-root element is rendered via html2canvas-pro, the iframe should be added inside the shadow root

Imagine we have custom style tags inside a shadow root. In our case, for some reason, such styles are not inlined to cloned nodes.
Then the iframe must be rendered inside the shadow root as well.

So an option like would work:

iframeParent: someNodeWithinShadowRoot

Or just automatically detect if a rendered node is inside a shadow root - append the iframe there as well, but this option technically a breaking behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions