How to use filesaver.js

后端 未结 6 629
南方客
南方客 2020-12-03 07:16

In the latest filesaver documentation, an example is given for how to use filesaver.js in conjunction with blobbuilder.js:

var bb = new BlobBuilder();
bb.app         


        
6条回答
  •  隐瞒了意图╮
    2020-12-03 07:57

    For people who want to load it in the console :

    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.src = 'https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js';
    document.body.appendChild(s);
    

    Then :

    saveAs(new Blob([data], {type: "application/octet-stream ;charset=utf-8"}), "video.ts")
    

    File will be save when you're out of a breakpoint (at least on Chrome)

提交回复
热议问题