Skip to content

Commit c3223e3

Browse files
authored
Merge pull request #41 from Rakambda/fix/gh-37
Fix settings export to file
2 parents 4c47732 + a8c28d8 commit c3223e3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

includes/js/YTTUtils.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,16 +652,15 @@ function YTTDownload(options) {
652652
*/
653653
function YTTDownloadObject(obj, name) {
654654
const jsonStr = JSON.stringify(obj);
655-
const blob = new Blob([jsonStr], {type: 'application/json'});
656-
const value = URL.createObjectURL(blob);
655+
const blob = btoa(jsonStr)
656+
const value = 'data:application/json;base64,' + blob
657657
return YTTDownload({
658658
url: value,
659659
filename: name,
660660
saveAs: true
661661
}).then(downloadId => {
662662
return new Promise(resolve => (typeof browser === 'undefined' ? chrome : browser).downloads.onChanged.addListener(download => {
663663
if (download.id === downloadId && (download.state && (download.state.current === 'interrupted' || download.state.current === 'complete'))) {
664-
URL.revokeObjectURL(value);
665664
resolve(download);
666665
}
667666
}));

0 commit comments

Comments
 (0)