felixfbecker / svg-screenshots

📸🧩 Browser extension to take scalable, semantic, accessible screenshots of websites in SVG format.
809 stars 29 forks source link

Canvas elements missing from SVG #123

Closed op3 closed 3 months ago

op3 commented 3 months ago

I tried to create a screenshot of a page that contains several <canvas> elements. These elements are missing from the resulting SVG. The rational for this is given here.

Obviously, including the canvas elements in the SVG is only possible as a raster image. However, I still think that including the raster images is beneficial in comparison to a pure raster screenshot: You retain all the other text elements and links that are included on the site. After all, other images are embedded as well.

Otherwise, this extension is working great, so I was surprised that parts of the screenshot I created were missing. Maybe this is something worth considering? Alternatively, I would suggest to add a small note to the README to mention that canvas elements are excluded.

felixfbecker commented 3 months ago

Agree, happy to accept a PR! It just wasn't implemented.

op3 commented 3 months ago

I just realized that this should be implemented in dom-to-svg instead. There is already a corresponding issue, and the workaround by @jkurkure works reasonably well. (Not sure if it’s useful for an actual implementation)