Safari开发者工具:如何在导航时保留控制台日志? [英] Safari Developer Tools: How to Preserve Console Log Upon Navigation?

查看:242
本文介绍了Safari开发者工具:如何在导航时保留控制台日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Safari Web Inspector 阅读JavaScript时控制台输出,日志在导航时重置,即从页面 index.html mail.html 清除控制台输出。在 Chrome开发者工具中,我可以通过右键单击控制台空间轻松保存日志。选择保留导航日志。使用此选项,控制台日志输出保持不变,直到我手动清除输出,简化了调试刷新或重定向到另一个页面的JavaScript的过程。



Safari Web Inspector中是否有类似的功能?

解决方案

我不知道这是什么时候添加的,但它存在于El Capitan的Safari(Safari 9.0)中。它与Chrome中的工作方式相同(右键单击控制台窗口并选择保持登录导航)。



更新:按照 Daniel Compton的答案,在Safari 11+中,现在设置图标为控制台:页面导航时清除。 / p>

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.

Is there a similar feature in Safari Web Inspector?

解决方案

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").

Update: As per Daniel Compton's answer, in Safari 11+ this is now under the settings icon as 'Console: Clear when page navigates'.

这篇关于Safari开发者工具:如何在导航时保留控制台日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆