Skip to content

Commit

Permalink
Merge pull request #1487 from mapleeit/support-blob-image-resources
Browse files Browse the repository at this point in the history
support blob image resources in non-foreignObjectRendering mode
  • Loading branch information
niklasvh authored Apr 1, 2018
2 parents 102b5a1 + 13bbc90 commit e6bbc1a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ResourceLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default class ResourceLoader {
if (this.hasResourceInCache(src)) {
return src;
}
if (isBlobImage(src)) {
this.cache[src] = loadImage(src, this.options.imageTimeout || 0);
return src;
}

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

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

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

0 comments on commit e6bbc1a

Please sign in to comment.