Skip to content

Commit e6bbc1a

Browse files
authored
Merge pull request niklasvh#1487 from mapleeit/support-blob-image-resources
support blob image resources in non-foreignObjectRendering mode
2 parents 102b5a1 + 13bbc90 commit e6bbc1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ResourceLoader.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export default class ResourceLoader {
3333
if (this.hasResourceInCache(src)) {
3434
return src;
3535
}
36+
if (isBlobImage(src)) {
37+
this.cache[src] = loadImage(src, this.options.imageTimeout || 0);
38+
return src;
39+
}
3640

3741
if (!isSVG(src) || FEATURES.SUPPORT_SVG_DRAWING) {
3842
if (this.options.allowTaint === true || isInlineImage(src) || this.isSameOrigin(src)) {
@@ -215,6 +219,7 @@ const INLINE_IMG = /^data:image\/.*/i;
215219

216220
const isInlineImage = (src: string): boolean => INLINE_IMG.test(src);
217221
const isInlineBase64Image = (src: string): boolean => INLINE_BASE64.test(src);
222+
const isBlobImage = (src: string): boolean => src.substr(0, 4) === 'blob';
218223

219224
const isSVG = (src: string): boolean =>
220225
src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);

0 commit comments

Comments
 (0)