diff --git a/src/core/cache-storage.ts b/src/core/cache-storage.ts index 2be98ed..3cd889e 100644 --- a/src/core/cache-storage.ts +++ b/src/core/cache-storage.ts @@ -96,6 +96,10 @@ export class Cache { //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous if (isInlineBase64Image(src) || useCORS) { img.crossOrigin = 'anonymous'; + // in chrome if the image loaded before without crossorigin it will be cached and used later even if the next usage has crossorigin + // so it will fail with CORS error, so add a random query parameter just to prevent the chrome from using the cached image + // see more info about the chrome issue in this link: https://stackoverflow.com/a/49503414 + src = src + (src.indexOf('?') === -1 ? '?' : '&') + 'cacheBusting=1'; } img.src = src; if (img.complete === true) {