Closed ryanfitzer closed 4 years ago
I added it for IE11 support, which works. But that causes Safari to error out with:
SyntaxError: The string did not match the expected pattern.
Is there a conditional I can use to add canvg? For example:
canvg
const options = someCondition ? { canvg: canvg } : {}; saveSvgAsPng( svg, 'svg.png', options );
I'm not exactly clear on what IE11 doesn't support that requires canvg to be used other than the error Rendered SVG images cannot be downloaded.
Rendered SVG images cannot be downloaded
I've looked through both codebases but I haven't figured out some sort of feature test I can use to target IE11.
Any guidance would be appreciated.
Here's what I ended up going with:
const options = ( typeof window.navigator.msSaveBlob !== 'undefined' ) ? { canvg: canvg } : {}; saveSvgAsPng( svg, 'svg.png', options );
I added it for IE11 support, which works. But that causes Safari to error out with:
Is there a conditional I can use to add
canvg
? For example:I'm not exactly clear on what IE11 doesn't support that requires
canvg
to be used other than the errorRendered SVG images cannot be downloaded
.I've looked through both codebases but I haven't figured out some sort of feature test I can use to target IE11.
Any guidance would be appreciated.