News for hackers. Stuff that matters.
Re:Show HN: Screenshots in Chrome, Globally Available by Sephr on Saturday March 14, 2020 @04:02AM (#22573875)
You can screenshot DOM structures natively by including them in an SVG <foreignObject>, composing an SVG blob URL, rendering it in an <img> tag, and then drawing that to a <canvas>.

I started a project related to this years ago but never finished it. Now that same-origin canvas taint issues have been fixed in most browsers, maybe it's time for me to work on this again.

A related API that is not accessible to web content is Safari's console.screenshot() utility[1].

[1]: https://twitter.com/webkit/status/1222236427326373888

There are no comments on this comment yet.