mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix external SVG loading with proxies (#802)
This commit is contained in:
@ -177,6 +177,7 @@ export class DocumentCloner {
|
||||
backgroundColor: '#ffffff',
|
||||
canvas: null,
|
||||
imageTimeout: this.options.imageTimeout,
|
||||
logging: this.options.logging,
|
||||
proxy: this.options.proxy,
|
||||
removeContainer: this.options.removeContainer,
|
||||
scale: this.options.scale,
|
||||
|
@ -34,16 +34,8 @@ export default class ResourceLoader {
|
||||
return src;
|
||||
}
|
||||
|
||||
if (isSVG(src)) {
|
||||
if (this.options.allowTaint === true || FEATURES.SUPPORT_SVG_DRAWING) {
|
||||
return this.addImage(src, src, false);
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
this.options.allowTaint === true ||
|
||||
isInlineBase64Image(src) ||
|
||||
this.isSameOrigin(src)
|
||||
) {
|
||||
if (!isSVG(src) || FEATURES.SUPPORT_SVG_DRAWING) {
|
||||
if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
|
||||
return this.addImage(src, src, false);
|
||||
} else if (!this.isSameOrigin(src)) {
|
||||
if (typeof this.options.proxy === 'string') {
|
||||
|
@ -65,6 +65,7 @@ const html2canvas = (element: HTMLElement, conf: ?Options): Promise<*> => {
|
||||
async: true,
|
||||
allowTaint: false,
|
||||
imageTimeout: 15000,
|
||||
logging: true,
|
||||
proxy: null,
|
||||
removeContainer: true,
|
||||
foreignObjectRendering: false,
|
||||
|
Reference in New Issue
Block a user