The short answer is, there is no way to get at the data you are after directly. The getHAR
method is only applicable to extensions meant to extend DevTools itself. The good news is, you can construct the HAR file yourself without too much trouble - this is exactly what phantom.js does.
- Start Chrome with remote debugging
- Connect to Chrome on the debugging port with a websocket connection
- Enable "Network" debugging, you can also clear cache, etc - see Network API.
- Tell the browser to navigate to the page you want to capture, and Chrome will stream all the request meta-data back to you.
- Massage the network data into HAR format, ala phantom.js
- ...
- Profit.
For a head start, I have a post that with sample Ruby code that should you get started with steps 1-4: http://www.igvita.com/2012/04/09/driving-google-chrome-via-websocket-api/