niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.44k stars 4.79k forks source link

Unable to clone canvas as it is tainted #3067

Open whitedxz opened 1 year ago

whitedxz commented 1 year ago

My dom element contains the others HTML tag, This error will be prompted ..... Hope to get a reply ....Hope to get a reply....Hope to get a reply... my code image image

whitedxz commented 1 year ago

supplement: dom container contains others HTML "canvas" tag

amitpatil321 commented 1 year ago

Anyone found any solution ?

mhshuvoalways commented 1 year ago

Still finding the solution

liuenci commented 10 months ago

I also meet this problem,please resolve it ?

guilhermenunes09 commented 9 months ago

I'm using the Google Maps API with React (react-google-maps) and discovered that the issue was related to a custom transparent icon I had created. I'm not entirely sure of the exact reason. It could be that the properties inferred that I was altering a Google Maps original icon, but I may be mistaken.

The best way to pinpoint the cause of the problem is to systematically delete lines of HTML, components, or code until the error no longer appears. This way, you can identify the root of the issue.


(NOTE: THIS CODE IS NOT THE SOLUTION; IT IS JUST WHAT CAUSED THE ISSUE IN MY CODE) I changed from

  const transparentIcon = {
    path: 'M0,0',
    fillColor: 'transparent',
    fillOpacity: 0,
    scale: 1,
    strokeWeight: 0
  };

to

   const transparentIcon = {
    path: 'M0,0'
  };