Skip to content

Commit 6d0818d

Browse files
Force download
1 parent bc47955 commit 6d0818d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

GUI/gui.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,15 @@ function savedb () {
120120
toc("Exporting the database");
121121
var arraybuff = event.data.buffer;
122122
var blob = new Blob([arraybuff]);
123-
var url = window.URL.createObjectURL(blob);
124-
window.location = url;
123+
var a = document.createElement("a");
124+
a.href = window.URL.createObjectURL(blob);
125+
a.download = "sql.db";
126+
a.onclick = function() {
127+
setTimeout(function() {
128+
window.URL.revokeObjectURL(a.href);
129+
}, 1500);
130+
};
131+
a.click();
125132
};
126133
tic();
127134
worker.postMessage({action:'export'});

0 commit comments

Comments
 (0)