We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f66aff3 commit 70d54b9Copy full SHA for 70d54b9
src/snapshot/filesaver.js
@@ -43,11 +43,16 @@ var fileSaver = function(url, name) {
43
}
44
45
if(canUseSaveLink) {
46
- saveLink.href = url;
+ // TODO polish up!!
47
+ var encoded = url.split(/^data:image\/svg\+xml,/)[1];
48
+ var svg = decodeURIComponent(encoded);
49
+ var objectUrl = URL.createObjectURL(new Blob([svg]));
50
+ saveLink.href = objectUrl;
51
saveLink.download = name;
52
document.body.appendChild(saveLink);
53
saveLink.click();
54
document.body.removeChild(saveLink);
55
+ URL.revokeObjectURL(objectUrl);
56
resolve(name);
57
58
0 commit comments