如何使 Google Chrome JavaScript 控制台持久化?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5327955/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 16:41:38  来源:igfitidea点击:

How to make Google Chrome JavaScript console persistent?

javascriptgoogle-chromeconsoledebugging

提问by Zlatko

Since I'm building a dynamic site, I need to track the changes between pages, ie. Ajax calls, POST, GET stuff and similar stuff.

由于我正在构建一个动态站点,因此我需要跟踪页面之间的更改,即。Ajax 调用、POST、GET 和类似的东西。

I'm looking for the same functionality like in Firebug (where you can enable "persistent" and the console is not cleared every time you reload a page or submit a form.

我正在寻找与 Firebug 相同的功能(您可以在其中启用“持久性”,并且每次重新加载页面或提交表单时都不会清除控制台。

So, my questions is: is there a way to make Google Chrome JavaScript console persistent?(And if yes, how?)

所以,我的问题是:有没有办法让 Google Chrome JavaScript 控制台持久化?(如果是,如何?)

Update: Copying the answer here, if anyone's still looking for this, Chrome 14+ has a setting in Developer Tools > Settings labelled "Console: Preserve log on navigation".

更新:在此处复制答案,如果有人仍在寻找此答案,Chrome 14+ 在开发者工具 > 设置中有一个标记为“控制台:保留登录导航”的设置。

Update 2: the latest versions of Chrome (33+) have this option by right-clicking in the console.

更新 2:最新版本的 Chrome (33+) 通过在控制台中右键单击来提供此选项。

Update 3(late 2017): The latest versions of Chrome (60+) have this option by opening the console, clicking the gear in the top right corner and selecting "preserve log"

更新 3(2017 年末):最新版本的 Chrome(60+)通过打开控制台,单击右上角的齿轮并选择“保留日志”来提供此选项

回答by Nick Cox

If anyone's still looking for this, I'm on Chrome 15.0.874.58 beta-m and I have a checkbox in Developer Tools > Settingslabelled "Console: Preserve log on navigation". Does the job nicely.

如果有人还在寻找这个,我在 Chrome 15.0.874.58 beta-m 上,我在开发者工具>设置中有一个复选框,标记为“控制台:保留登录导航”。干得漂亮。

image of setting

设置图像

回答by Simon

enter image description here

enter image description here

at Version 67.0.3396.87 (Official Build) (64-bit)

在版本 67.0.3396.87(官方版本)(64 位)

回答by BenM

Unfortunately, Chrome doesn't support that functionality yet, although there was talk in December 2010 about adding in the next major release...

不幸的是,Chrome 尚不支持该功能,尽管 2010 年 12 月曾讨论要在下一个主要版本中添加...

This answer is no longer valid

此答案不再有效

回答by Kris

Try this to enable console on popups

试试这个在弹出窗口上启用控制台

enter image description here

enter image description here

回答by Thomas Rokicki

As of Chrome Version 73.0.3683.86 (Official Build) (64-bit):

从 Chrome 版本 73.0.3683.86(官方版本)(64 位)开始:

  1. Click the ellipsis in top right of Developer Tools top ellipsis
  2. Navigate to Settings > Preferences > Console
  3. Check Preserve log upon navigation
  1. 单击开发者工具右上角的省略号 top ellipsis
  2. 导航 Settings > Preferences > Console
  3. 查看 Preserve log upon navigation

console options

console options