Skip to content

Commit 794dfd6

Browse files
eliminate *objectURL since problematic in Safari and we are only using svg
1 parent 753ef0e commit 794dfd6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/snapshot/svgtoimg.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function svgToImg(opts) {
1717
var promise = new Promise(function(resolve, reject) {
1818

1919
var Image = window.Image;
20-
var Blob = window.Blob;
2120

2221
var svg = opts.svg;
2322
var format = opts.format || 'png';
@@ -26,6 +25,9 @@ function svgToImg(opts) {
2625
var ctx = canvas.getContext('2d');
2726
var img = new Image();
2827

28+
// for Safari support, eliminate createObjectURL
29+
// this decision could cause problems if content
30+
// is not restricted to svg
2931
var base64Svg = 'data:image/svg+xml,' + encodeURIComponent(svg);
3032

3133
canvas.height = opts.height || 150;
@@ -74,7 +76,7 @@ function svgToImg(opts) {
7476
}
7577
};
7678

77-
img.src = url;
79+
img.src = base64Svg;
7880
});
7981

8082
// temporary for backward compatibility

0 commit comments

Comments
 (0)