diff options
Diffstat (limited to 'src/js/utils.js')
-rw-r--r-- | src/js/utils.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/js/utils.js b/src/js/utils.js index 74f3cfa..a952328 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -26,4 +26,13 @@ export function debugLog(message) { if (showDebug) console.log(message); } + +export function offerDownloadableData(data) +{ + var link = document.createElement('a'); + link.download = 'data'; + var blob = new Blob([data]); // , {type: 'text/plain'} + link.href = window.URL.createObjectURL(blob); + link.click(); +} // @license-end |