Skip to content
This repository was archived by the owner on Aug 1, 2022. It is now read-only.

Commit a2313b0

Browse files
committed
Prevent SecurityError
Fixes #70
1 parent 1d7652d commit a2313b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ export default class extends PureComponent {
167167
// Load the image
168168
this.image = new Image();
169169

170+
// Prevent SecurityError "Tainted canvases may not be exported." #70
171+
this.image.crossOrigin = "anonymous";
172+
170173
// Draw the image once loaded
171174
this.image.onload = () =>
172175
drawImage({ ctx: this.ctx.grid, img: this.image });

0 commit comments

Comments
 (0)