【问题标题】:How to create and save file in developer tools console of google chrome browser?如何在谷歌浏览器的开发者工具控制台中创建和保存文件?
【发布时间】: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/

上找不到任何相关内容

有什么方法可以直接从consoledeveloper toolsgoogle 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


【解决方案1】:

您可以简单地使用鼠标右键 => 另存为,这将创建一个包含控制台日志的文件。

【讨论】:

    猜你喜欢
    • 2012-08-12
    • 1970-01-01
    • 2013-02-21
    • 1970-01-01
    • 2013-02-28
    • 2013-11-12
    • 2012-06-20
    • 2016-07-09
    • 2016-07-02
    相关资源
    最近更新 更多