Canvas errors & CORS All In One

xgqfrms發表於2024-04-25

Canvas errors & CORS All In One

Uncaught (in promise) DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

solution


<img crossorigin="anonymous" data-src="" src="" />


demos

image

https://renmingliang.github.io/vue-lottery/#/lottery

https://github.com/renmingliang/vue-lottery

(🐞 反爬蟲測試!打擊盜版⚠️)如果你看到這個資訊, 說明這是一篇剽竊的文章,請訪問 https://www.cnblogs.com/xgqfrms/ 檢視原創文章!

Allowing cross-origin use of images and canvas

https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image

refs

https://stackoverflow.com/questions/22710627/tainted-canvases-may-not-be-exported

https://github.com/niklasvh/html2canvas/issues/1614

https://github.com/fabricjs/fabric.js/issues/5046



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 釋出文章使用:只允許註冊使用者才可以訪問!

原創文章,版權所有©️xgqfrms, 禁止轉載 🈲️,侵權必究⚠️!


相關文章