tsayen / dom-to-image

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

Issues with styles when using with Chrome #226

Open jonathanpuc opened 6 years ago

jonathanpuc commented 6 years ago

Use case: description, code

Hello, great library!

I'm having a little trouble when using it on Chrome.

When using it on Chrome, no styling is applied to the nodes before they are captured. When using it on Mozilla, it works fine.

First I was given the error saying it couldn't read the css rules from the stylesheet (CORS) with Chrome. So I just created a local css file and imported that instead. The error dissapeared but still facing the same issue, no styles.

jsfiddle

Expected behavior

Styles applied to targeted node when capturing and saving it as png on Chrome.

Actual behavior (stack traces, console logs etc)

No styles applied.

Library version

^2.6.0

Browsers

demidenko-yura commented 6 years ago

I have the same trouble in Chrome, but in Firefox works fine https://jsfiddle.net/kuou44ry/31/

If move style from CSS into