【发布时间】:2021-07-16 17:06:17
【问题描述】:
var data = "my sample data string"
// Lets write this data to filesystem as data.txt
我在
https://developer.chrome.com/docs/devtools/console/
有什么方法可以直接从console 到developer tools 到google chrome 中创建和保存文件?
【问题讨论】:
-
Object.assign(document.createElement('a'), {download: 'data.txt', href: URL.createObjectURL(new Blob([data]))}).dispatchEvent(new MouseEvent('click'))
标签: google-chrome filesystems google-chrome-devtools