We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
*objectURL
svg
1 parent 753ef0e commit 794dfd6Copy full SHA for 794dfd6
src/snapshot/svgtoimg.js
@@ -17,7 +17,6 @@ function svgToImg(opts) {
17
var promise = new Promise(function(resolve, reject) {
18
19
var Image = window.Image;
20
- var Blob = window.Blob;
21
22
var svg = opts.svg;
23
var format = opts.format || 'png';
@@ -26,6 +25,9 @@ function svgToImg(opts) {
26
25
var ctx = canvas.getContext('2d');
27
var img = new Image();
28
+ // for Safari support, eliminate createObjectURL
29
+ // this decision could cause problems if content
30
+ // is not restricted to svg
31
var base64Svg = 'data:image/svg+xml,' + encodeURIComponent(svg);
32
33
canvas.height = opts.height || 150;
@@ -74,7 +76,7 @@ function svgToImg(opts) {
74
76
}
75
77
};
78
- img.src = url;
79
+ img.src = base64Svg;
80
});
81
82
// temporary for backward compatibility
0 commit comments