Hacker News new | ask | show | jobs
by Aaron1011 3076 days ago
> As of now, text rendering methods are missing and for security reasons you cannot read back pixels from the canvas.

Does anyone have an idea as to what those reasons might be? I've heard of JavaScript access to certain CSS features being limited (e.g. getComputedStyle()), but I'm not sure what the benefit is here. Is there any way that user information could be leaked through a paint worklet context?

3 comments

We made a mistake in the article there. (There aren't any security issues with pixel read-back here) I'll ping Surma on Monday to get it fixed.

The primary reason we did this is to ensure there wasn't a performance cliff if you did read-back pixels. With the current API surface you can record all of the canvas commands, and play them back when you need to raster. Additionally it doesn't leak how many pixels we are actually rastering to.

(hope this helps).

Finger printing the user is the main reason why.
canvas/font fingerprinting