Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion background-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
url = url.slice(4, -1);
url = url.replace(/"/g, '');

// Fix for "tainted canvas" https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image
list[e].img.crossOrigin = 'Anonymous';

list[e].img.src = url;
log('CSS Image - ' + url);
} else {
Expand Down Expand Up @@ -498,9 +501,13 @@
var area = getArea(image);

image = image.nodeType ? image : image.img;

var imageCopy = new Image();
imageCopy.crossOrigin = 'Anonymous';
imageCopy.src = image.src;

if (area.imageWidth > 0 && area.imageHeight > 0 && area.width > 0 && area.height > 0) {
context.drawImage(image,
context.drawImage(imageCopy,
area.imageLeft, area.imageTop, area.imageWidth, area.imageHeight,
area.left, area.top, area.width, area.height);
} else {
Expand Down
2 changes: 1 addition & 1 deletion background-check.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.