qq15725 / modern-screenshot

📸 Quickly generate image from DOM node using HTML5 canvas and SVG
https://www.toolpkg.com/image/html-to-image
MIT License
457 stars 32 forks source link

新版火狐浏览器下内容多时使用domToCanvas提示Failed image load ,图片黑屏 #91

Open mtxue97 opened 2 months ago

mtxue97 commented 2 months ago

Steps To Reproduce

构造大量网页数据,大概两屏,包含echarts图表、表格、图片类的数据,将网页转成图片 domToImage或domToCanvas在火狐有大量的重复样式,导致img的src数据内容超过32MB,Chrome正常,只有火狐的10%左右

Playground for https://codesandbox.io

Playground for https://codepen.io

Playground for https://play.vuejs.org

Error Message & Stack Trace

```txt [modern-screenshot] Failed image load data:image/svg+xml;charset=utf-8,..... error { target: img, isTrusted: true, srcElement: img, currentTarget: img, eventPhase: 2, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false...... ```

Your Environment

mtxue97 commented 2 months ago

image