Safari Developer Tools: How to Preserve Console Log Upon Navigation?(Safari 开发者工具:如何在导航时保留控制台日志?)
问题描述
使用 Safari Web Inspector 读取 JavaScript 时控制台输出,日志在导航时重置,即从页面 index.html 到 mail.html 会清除控制台输出.在 Chrome 开发者工具中,我可以通过右键单击控制台空间来轻松保存日志,然后选择在导航时保留日志.使用此选项,控制台日志输出将保持不变,直到我手动清除输出,从而简化了刷新或重定向到另一个页面的 JavaScript 调试过程.
When using Safari Web Inspector to read the JavaScript console output, the log is reset upon navigation i.e. going from page index.html to mail.html clears the console output. In the Chrome Developer Tools, I can easily preserve the log by right clicking on the console space and selecting Preserve Log Upon Navigation. With this option, console log output remains intact until I manually clear the output simplifying the process of debugging JavaScript that refreshes or redirects to another page.
Safari Web Inspector 中是否有类似的功能?
Is there a similar feature in Safari Web Inspector?
推荐答案
我不知道这是什么时候添加的,但它存在于 El Capitan 上的 Safari(Safari 9.0)中.它与 Chrome 中的工作方式相同(在控制台窗口中单击鼠标右键并选择保持登录导航").
I don't know when this was added, but it is present in Safari on El Capitan (Safari 9.0). It works the same as in Chrome (right click in the console window and select "Keep Log on Navigation").
更新:根据 Daniel Compton 的回答,现在在 Safari 11+ 中设置图标为控制台:页面导航时清除".
Update: As per Daniel Compton's answer, in Safari 11+ this is now under the settings icon as 'Console: Clear when page navigates'.
更新:设置现在恢复为保留日志".在 Safari 14+ 的开发者控制台中的网络"选项卡中
Update: The setting is now back to "Preserve log" in the Network tab in the developer console in Safari 14+
这篇关于Safari 开发者工具:如何在导航时保留控制台日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Safari 开发者工具:如何在导航时保留控制台日志


- 如何显示带有换行符的文本标签? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01