File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -652,16 +652,15 @@ function YTTDownload(options) {
652
652
*/
653
653
function YTTDownloadObject ( obj , name ) {
654
654
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
657
657
return YTTDownload ( {
658
658
url : value ,
659
659
filename : name ,
660
660
saveAs : true
661
661
} ) . then ( downloadId => {
662
662
return new Promise ( resolve => ( typeof browser === 'undefined' ? chrome : browser ) . downloads . onChanged . addListener ( download => {
663
663
if ( download . id === downloadId && ( download . state && ( download . state . current === 'interrupted' || download . state . current === 'complete' ) ) ) {
664
- URL . revokeObjectURL ( value ) ;
665
664
resolve ( download ) ;
666
665
}
667
666
} ) ) ;
You can’t perform that action at this time.
0 commit comments