Skip to content

Instantly share code, notes, and snippets.

@alfrescian
alfrescian / HOWTO.md
Last active April 5, 2018 19:12 — forked from cvan/HOWTO.md
get all GET URLs of all network requests made on a web page from the Chrome Dev Tools (from an exported HAR)

Setup

Using Homebrew on Mac OS X:

brew install jq

Add these aliases to your profile (e.g., ~/.zshrc, ~/.bashrc, ~/.profile, etc.):

alias getUrls='pbpaste | jq ".log.entries" | tee >(jq --raw-output "[.[] | select(.request.method == \"GET\")|.request.url] | .[]")'

alias getUrlsTime='pbpaste | jq ".log.entries" | tee >(jq --raw-output "[.[] | select(.request.method == "GET")|.request.url,"blocked :"+(.timings.blocked|tostring),"wait: " + (.timings.wait|tostring), "receive: " + (.timings.receive|tostring)] | .[]")'