• Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create HAR files from Chrome Debugging Protocol data

Chrome-har

Unit tests

Create HAR files based on Chrome DevTools Protocol data.

Code originally extracted from Browsertime, initial implementation inspired by Chromedriver_har.

Create a new bug report

Make sure to generate a event trace log file that we can use to recreate your issue. If you use Browsertime you can enable the trace with --chrome.collectPerfLog:

$ browsertime --chrome.collectPerfLog -n 1 https://www.sitespeed.io

Then take the file named chromePerflog-1.json.gz and put it in a gist or make it availible to us in any way you want.

If you use sitespeed.io:

$ sitespeed.io --browsertime.chrome.collectPerfLog -n 1 https://www.sitespeed.io

Support for Response Bodies

If you use Chrome-har standalone (without Browsertime/sitespeed.io) you can use get the response bodies in HARs if they are set on the response object by the caller and if the includeTextFromResponseBody option is set to true.

For example:

const harEvents: Array<any> = [];

client.on('Network.requestIntercepted', async (params: any) => {
  // Get the response body
  const response = await client.send(
    'Network.getResponseBodyForInterception',
    { interceptionId: params.interceptionId },
  );

  // Set the body on the response object
  if (params.response != null) {
    params.response.body = response.body;
  } else {
    params.response = response;
  }

  // Continue the request
  await client.send(
    'Network.continueInterceptedRequest',
    { interceptionId: params.interceptionId },
  );

  harEvents.push({ method, params });
});

const har = harFromMessages(harEvents, {includeTextFromResponseBody: true});

More Repositories

1

sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your websiteโ€™s speed using real browsers in various environments.
JavaScript
4,716
star
2

coach

Clear Eyes. Full Hearts. Canโ€™t Lose.
JavaScript
1,204
star
3

browsertime

Measure and Optimize Web Performance
JavaScript
602
star
4

throttle

Throttle your network connection [Linux/Mac OS X]
JavaScript
332
star
5

compare

Compare HAR files.
JavaScript
110
star
6

pagexray

Xray your HAR file and know all about the page
JavaScript
83
star
7

grafana-bootstrap-docker

Shell
60
star
8

sitespeed.io-docker

Shell
52
star
9

dashboard.sitespeed.io

Example how to use sitespeed.io to monitor the performance of your web site
JavaScript
45
star
10

jenkins.sitespeed.io

A Jenkins plugin for sitespeed.io
Java
31
star
11

grunt-sitespeedio

Test performance budgets and performance best practice rules using sitespeed.io
JavaScript
28
star
12

plugin-lighthouse

Lighthouse plugin for sitespeed.io
JavaScript
26
star
13

chrome-trace

Process Chrome trace logs in Node.
JavaScript
14
star
14

plugins

List of 3rd party plugins for sitespeed.io
10
star
15

run.sitespeed.io

Online version of sitespeed.io
JavaScript
9
star
16

docker-browsers

Dockerfile
8
star
17

plugin-gpsi

GPSI plugin for sitespeed.io
JavaScript
7
star
18

humble

Raspberry Pi WiFi network link conditioner
6
star
19

plugin-third-party-decode

Run Paul Irish Third Party Decode library to categorise third parties
JavaScript
5
star
20

chromedriver

Install and launch Chromedriver for Mac, Linux or Windows.
JavaScript
4
star
21

sltc

JavaScript
4
star
22

browsertime-extension

Extension that runs in Firefox/Chrome to get some extra fire for Browsertime
JavaScript
3
star
23

logo

All the logos for sitespeed.io
3
star
24

plugin-webpagetest

sitespeed.io plugin for running WebPageTest
JavaScript
2
star
25

travis

Example repo for using sitespeed.io budget using Travis
HTML
2
star
26

docker-node

Base Docker container for sitespeed.io with Ubuntu & NodeJS
Dockerfile
1
star
27

raspberrypi

Pre-made raspberry pi image to drive Android phones
1
star
28

geckodriver

Install and launch Geckodriver for Mac, Linux or Windows.
JavaScript
1
star