Closed ziinfo closed 7 years ago
I'm seeing this problem too. I've been using the same conversion method as saveSvgAsPng
does in my code, and it has been working in the past in Safari, but not properly in the newest version.
Can you be more specific about what's not working? Does the download fail? Are there any errors in the developer console? Does the test page show any images?
@exupero: In the jsfiddle above, the download is not triggered. Only one error in console ("Error while parsing the 'sandbox' attribute: 'allow-modals' is an invalid sandbox flag.") but it's presumably related to the Jsfiddle sandbox.
Test page: With linked SVG image -> Preview is empty At a higher resolution -> In preview pixelated rectangle is missing With foreign objects -> Preview empty When setting xmlns on foreign object children -> Preview empty With custom fonts -> Preview empty
Console:
@amergin: I don't think it's Jsfiddle related, you don't get this error in Chrome and it works in Safari 9 despite the error
@exupero: Safari 10 renders images correctly, however I get error:
Rendered SVG images cannot be downloaded in this browser.
Sounds like Safari 10 throws a SecurityError
like IE. You'll likely need to use canvg to work around it. See the Support section of the Readme.
Just spotted: With foreign objects -> Preview empty When setting xmlns on foreign object children -> Preview empty
the rest renders fine
If you turn off the popup blocker, it should open the png. unfortunately it doesn't seem that safari supports the download attribute on anchor tags, not sure if there is a fix for that.
saveSvgAsPng is not working in Safari 10.0.1 I have tested it on: Safari version 10.0.1 - not working Safari version 9.1.2 - works
https://jsfiddle.net/ziinfo/qj56axqk/