mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Allow tainting images to be drawn if option enabled
This commit is contained in:
parent
c20e679f2c
commit
2a020e5a21
@ -34,7 +34,7 @@ ImageLoader.prototype.loadImage = function(imageData) {
|
||||
var src = imageData.args[0];
|
||||
if (src.match(/data:image\/.*;base64,/i)) {
|
||||
return new ImageContainer(src.replace(/url\(['"]{0,}|['"]{0,}\)$/ig, ''), false);
|
||||
} else if (/(.+).svg$/i.test(src) && !this.support.svg) {
|
||||
} else if (/(.+).svg$/i.test(src) && !this.support.svg && !this.options.allowTaint) {
|
||||
return new SVGContainer(src);
|
||||
} else if (this.isSameOrigin(src) || this.options.allowTaint === true) {
|
||||
return new ImageContainer(src, false);
|
||||
|
@ -42,7 +42,7 @@ CanvasRenderer.prototype.taints = function(imageContainer) {
|
||||
};
|
||||
|
||||
CanvasRenderer.prototype.drawImage = function(imageContainer, sx, sy, sw, sh, dx, dy, dw, dh) {
|
||||
if (!this.taints(imageContainer)) {
|
||||
if (!this.taints(imageContainer) || this.options.allowTaint) {
|
||||
this.ctx.drawImage(imageContainer.image, sx, sy, sw, sh, dx, dy, dw, dh);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user