Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdom-screenshot not generating a screenshot for web components #27

Open
eladtzemach opened this issue Jun 12, 2022 · 2 comments
Open

Comments

@eladtzemach
Copy link

Hi, i have a React component that uses web components (imported from a third-party library).
I noticed that jsdom-screenshot does not render the UI rendered by those web components, and only renders the UI of other HTML elements.
Is there a way to get the screenshots to render the web components as well?

@dferber90
Copy link
Owner

dferber90 commented Jun 21, 2022

Interesting! I haven't used web components myself, so I'm not very helpful here.

A wild guess is that this line might not catch the HTML when a web component is used, as JSDOM might not be "rendering" the web component?

const html = document.documentElement.outerHTML;

@eladtzemach
Copy link
Author

Yeah it looks like this could be the case.
To get the HTML of a web component, we might need to use the ShadowRoot.innerHTML API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants