0

I'm getting this error when I try to load remote image and call toDataURL in the background js code file.

SecurityError: The operation is insecure.

I tried playing with CORS but it doesn't helped. Any solution or this? Btw this code works fine in Chrome extension.

Evgeniy
  • 193
  • 3
  • 19
  • Please [edit] the question to be on-topic: include a **complete** [mcve] that duplicates the problem. Including a *manifest.json*, some of the background *and* content scripts. Questions seeking debugging help ("**why isn't this code working?**") must include: ►the desired behavior, ►a specific problem or error *and* ►the shortest code necessary to reproduce it **in the question itself**. Questions without a clear problem statement are not useful to other readers. See: "**How to create a [mcve]**", [What topics can I ask about here?](http://stackoverflow.com/help/on-topic), and [ask]. – Makyen Dec 08 '16 at 15:44
  • 1
    try downloading the image data via xhr or fetch instead – the8472 Dec 10 '16 at 13:57
  • @the8472 I can't, this is jsPDF addimage.js plugin code it contains this line: canvas.toDataURL... – Evgeniy Dec 10 '16 at 20:31

0 Answers0