mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
adjusted cors
This commit is contained in:
parent
7222aba1b4
commit
42e2d906ef
@ -1,6 +1,6 @@
|
||||
{
|
||||
"title": "html2canvas",
|
||||
"name": "html2canvas",
|
||||
"title": "html2canvas-cors",
|
||||
"name": "html2canvas-cors",
|
||||
"description": "Screenshots with JavaScript",
|
||||
"main": "dist/html2canvas.js",
|
||||
"module": "dist/html2canvas.esm.js",
|
||||
@ -111,6 +111,6 @@
|
||||
"homepage": "https://html2canvas.hertzen.com",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"css-line-break": "1.1.1"
|
||||
"css-line-break": "^1.1.1"
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,11 @@ export class Cache {
|
||||
if (isInlineBase64Image(src) || useCORS) {
|
||||
img.crossOrigin = 'anonymous';
|
||||
}
|
||||
if (src.indexOf('data:') === -1)
|
||||
src = `${src}${src.indexOf('?') > -1 ? '&' : '?'}v=${new Date().getTime()}`;
|
||||
|
||||
img.src = src;
|
||||
|
||||
if (img.complete === true) {
|
||||
// Inline XML images may fail to parse, throwing an Error later on
|
||||
setTimeout(() => resolve(img), 500);
|
||||
|
Loading…
Reference in New Issue
Block a user