tsayen / dom-to-image

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

Proxy setting #252

Open soracoder opened 5 years ago

soracoder commented 5 years ago

Hi! I have added a proxy setting in order to avoid the problem with CORS with the images on the DOM. It works adding the option in the constructor, for example: const blob = await domtoimage.toBlob(node, { width: node.offsetWidth, height: node.offsetHeight, proxy: 'http://myproxyurl' })

For Me, this was the best solution to solve the problem that I have with the load of cross-domain images. Hope this helps everyone.