Add support for Shadow DOM/Custom elements #140
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
First of all, thanks very much for creating dom-to-svg as well as svg-screenshots!
From all the HTML-to-SVG stuff I've tried, dom-to-svg works best, almost perfect.
One thing that appears to be missing though is support for Shadow DOM/Custom elements, correct?
Probably easiest to discuss on my use case:
I'm looking into building "svgcaniuse", SVGs of caniuse.com, e.g. https://caniuse.com/web-share.
Using svg-screenshots to capture the viewport of https://caniuse.com/web-share results in this:
Because the DOM looks like this:
I've tried my way around the first shadow-root like so using DevTools:
But "of course" the resulting svgString only contains the equivalents of
.feature-list-wrap
and<ciu-feature>
(without any children since it's got the next shadow-root), i.e. just a brown background:Not sure if that would suffice, but basically something like this could make it work:
I've had a look at the source but wasn't confident enough to start a PR.
Would be great though if dom-to-svg would work with Shadow DOM :)
The text was updated successfully, but these errors were encountered: