niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.42k stars 4.79k forks source link

The performance problem with cloning document contains a lot of SVG nodes #2495

Open ybaturin opened 3 years ago

ybaturin commented 3 years ago

Bug reports:

If a page contains a log of SVG nodes, e.g. amCharts (based on SVG), the call html2canvas(pageNode) freezes Firefox & Safari for a while. It could take several minutes. Just compare:

Suggestion

Add an option in html2canvas to turn off copyCssStyles in SVG nodes.

Specifications:

steven-wilson-crl commented 3 years ago

I have this same issue (of an SVG heavy chart taking 30+ seconds to render all while hanging the entire web site in safari), so... +1 on this being needed!

Finesse commented 2 years ago

Cloning the whole page to take a screenshot of a small part is an overkill IMHO. I'm wondering whether there is a way to not clone the whole page.

BlueLamantine commented 2 years ago

@niklasvh It makes sense. Please, pay attention to this