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