How to enable “Preserve Log” in Network tab in Chrome developer tools by default?

后端 未结 2 758
清酒与你
清酒与你 2020-12-24 10:48

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 checkbo

相关标签:
2条回答
  • 2020-12-24 11:05

    I have a small solution to that problem. I don't know whether it works correctly.First, click three dots->More tools -> Developer Tools. In that, click the three dots button(the name will be Customize and Control Dev Tools. In that, click settings.You will see a list of options with a main heading Preferences. From that, browse down to Console option. In that, just tick the option 'Preserve log upon navigation'. I guess this will solve your problem.

    0 讨论(0)
  • 2020-12-24 11:15

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

    • 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
    

    Use the script as

    ./chrome_auto.sh "https://stackoverflow.com/questions/45133659"
    
    • 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 &

    0 讨论(0)
提交回复
热议问题