I didn't found an satisfying dupe target, so I'll rewrite it as an answer :
Drawing an SVG image through drawImage
method will taint the canvas in IE < Edge for security reasons.
This operation is somehow sensitive for browsers, since svg images imply to parse some XML, and that it can contain some tricky elements (though IE doesn't support <foreignObject>
...)
So quite often, browsers will add security restrictions when SVG images are drawn to it, and will block all exporting methods.
This is the case in safari > 9 when an <foreignObject>
is drawn on it, this was also the case in chrome, but only when the image comes from an Blob (an implementation bug, but they finally leveraged the security restriction altogether anyway).
And then in IE < Edge, with any SVG.
The only way to workaround this issue is to parse yourself the SVG, and then use the canvas' methods to reproduce it.
This is all doable, but can take some time to implement, so even though I don't really like it, you'd probably be better using an library like canvg, which does exactly this (parsing + rendering with canvas methods).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…