jsdom-screenshot
jsdom-screenshot copied to clipboard
jsdom-screenshot not generating a screenshot for web components
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?
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?
https://github.com/dferber90/jsdom-screenshot/blob/4bcc86e858bdfe7fc03e0e352d07d57ed0b41942/generateImage.js#L115
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.