electron-har
A command-line tool for generating HTTP Archive (HAR) (based on Electron).
The data you get is identical to "Chromium -> Developer Tools -> Network pane -> Save All as HAR".
Installation
Prebuilt binaries can be found on the release(s) page.
You can also use npm:
npm install -g electron-har
In order for Electron to work on Debian/Ubuntu (specifically on Debian 8/Ubuntu 12.04) following packages have to be installed
libgtk2.0-0 libgconf-2-4 libasound2 libxtst6 libxss1 libnss3
.
Usage
NOTE for Linux users: you might need to --disable-gpu
# NOTE: on Linux --disable-gpu might be needed electron-har http://google.com # writes HAR to stdout # in case something doesn't look right / not working ELECTRON_ENABLE_LOGGING=1 electron-har --disable-gpu --show http://google.com 2>electron.log # in a headless environment (CI agent on Linux?) - xvfb-run will do just fine DISPLAY=:1 xvfb-run electron-har http://google.com -o google_com.har # to see a complete list of command line options electron-har --help
... or pragmatically
const electronHAR =
In a headless environment you might want to use kesla/headless (which will start Xvfb for you).
const headless = const electronHAR = { if !processenvDISPLAY else process } { if err throw err }