如何启用“保留日志"功能;默认情况下在Chrome开发者工具的“网络"标签中显示? [英] How to enable "Preserve Log" in Network tab in Chrome developer tools by default?

查看:477
本文介绍了如何启用“保留日志"功能;默认情况下在Chrome开发者工具的“网络"标签中显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下如何在Chrome开发者工具的网络工具中启用保留日志"?每次按F12键,然后选择网络"选项卡时,我需要单击保留日志"复选框以使其保留请求/响应.默认情况下是否可以一直对其进行检查?

How to enable "Preserve Log" in Network tools in Chrome developer tools by default? Everytime I press F12 and then select Network tab, I need to click preserve log checkbox to make it preserve request/responses. Is it possible to have it checked all the time by default?

通过此功能可以在"Firefox开发人员"版本中使用.当我单击"Persist Logs"并关闭,然后打开浏览器时,& DEV工具窗口再次出现,仍处于选中状态.

By the way this feature works in "Firefox Developer" edition. When I click "Persist Logs" and close and then open the browser & DEV tools window again, it is still checked.

该问题将在Chrome 73中修复.但是,如果您想在此之前尝试一下,请安装 Dev工具设置并选中/取消选中网络下的保留日志"部分,如下所示.

This will be fixed in Chrome 73. But if you want to try it before that then install Chrome Canary. It's working there. To enable/disable this persistence just go to Dev tools settings and check/uncheck Preserve Log under network section as shown below.

感谢团队对其进行修复.迟到总比没有好.

Thanks to the team for fixing it. Better late than never.

推荐答案

自动执行击键操作,以通过网络"标签上的持久性日志设置镶边.经过Chrome 66测试.

Automate keystrokes to set chrome with persistent logs on Network tab. Tested with Chrome 66.

  • 确保已安装xdotool
  • 启动chrome
  • 将以下代码放入bash脚本chrome_auto.sh中,以将所有密钥发送至:打开选项卡,开发工具,设置,设置永久日志",键入URL并按Enter.
  • Make sure xdotool is installed
  • Launch chrome
  • Put the code below in a bash script chrome_auto.sh to send all the keys to: open a tab, dev tools, settings, set 'persistent logs', type the URL and hit enter.
#!/bin/bash

url="https://www.stackoverflow.com"
if [ -n "$1" ]; then
    url="$1"
fi

# find chrome window id
wid=$(xdotool search --class Chromium | tail -n1)
# build tab key sequence to set 'persistent logs'
tabkeys=$(for i in {1..24}; do t+="Tab ";done ;echo "$t space")
# base xdotool command
cmd="xdotool windowactivate --sync $wid"
# make chrome dance :-p
$cmd key ctrl+t
$cmd key F12
sleep 1
# open settings, move to desired option and select it
$cmd key F1 $tabkeys
sleep 1
# move cursor to URL box and type URL
$cmd key F6 type "$url"
$cmd key Return

将该脚本用作

./chrome_auto.sh "https://stackoverflow.com/questions/45133659"

  • 此外,可以在为每个标签页打开开发工具的情况下启动chrome.如果使用此选项,请用key F12
  • 注释掉该行.

    • Also, chrome can be launched with dev tools open for every tab. If this is used, comment out the line with key F12
    • chromium --auto-open-devtools-for-tabs > /dev/null 2>&1 &

      这篇关于如何启用“保留日志"功能;默认情况下在Chrome开发者工具的“网络"标签中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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