tsayen / dom-to-image

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

Unhandled Promise rejection in firefox #441

Open theSumit67 opened 1 year ago

theSumit67 commented 1 year ago

Use case: description, code

I am using Angular framework. dom-to-image library is loaded as script tag from assets. Sample

const content = document.getElementsByClassName("app-wrapper")[0];
domtoimage.toBlob(content).then((imgData) => {
    formData.append("file", imgData, "screenshot.png");
    // formData used in a API .......
});

On chrome its working fine, however on firefox its generating following error -

image

Stack trace -

image

image

Browsers

qq15725 commented 1 year ago

You can try https://github.com/qq15725/modern-screenshot

seems to be an svg+xml problem with no encode uri