使用 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 开发者工具:如何在导航时保留控制台日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Electron 渲染器进程中创建子窗口时如何修复How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器进程中创建子窗口
mainWindow.loadURL("https://localhost:3000/") 在 EmainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 应用程
Electron webContents executeJavaScript:无法在第二个 loaElectron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:无法在第二个 loadURL 上
如何在angular-cli的组件内使用电子浏览器窗口?how to use electron browser window inside components in angular-cli?(如何在angular-cli的组件内使用电子浏览器窗口?)
ElectronJS - 在 Windows 之间共享 redux 存储?ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之间共享 redux 存储?)
如何在电子应用程序中访问相机/网络摄像头?How to access camera/webcamera inside electron app?(如何在电子应用程序中访问相机/网络摄像头?)