tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.37k stars 1.68k forks source link

Improvement: use getScreenshot method for Firefox #193

Closed OEvgeny closed 4 years ago

OEvgeny commented 6 years ago

Use case: description, code

Firefox has some feature to capture DOM out of the box. Here is the article: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/getScreenshot

I didn't dig into dom-to-image, so I don't know how difficult it would be to implement. But I think that implementing such approach can improve things for Firefox. Although I'm not sure.

Anyway, this aims to show what there is at least some opportunity for Firefox to do that.

Thanks for the great work!

zaygraveyard commented 6 years ago

The getScreenshot feature is on supported in chrome code (see the note at the bottom of the link article) Which means it can't be used by web pages :disappointed: