{"id":13583719,"url":"https://github.com/sitespeedio/chrome-har","last_synced_at":"2025-05-14T20:08:46.088Z","repository":{"id":18556732,"uuid":"82726768","full_name":"sitespeedio/chrome-har","owner":"sitespeedio","description":"Create HAR files from Chrome Debugging Protocol data","archived":false,"fork":false,"pushed_at":"2025-02-15T13:48:51.000Z","size":1957,"stargazers_count":152,"open_issues_count":41,"forks_count":50,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-30T11:04:40.694Z","etag":null,"topics":["chrome","har"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sitespeedio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-21T21:02:33.000Z","updated_at":"2025-01-18T14:41:48.000Z","dependencies_parsed_at":"2024-11-09T14:21:22.701Z","dependency_job_id":"5e644ece-3aad-40fc-b047-b413f63a314e","html_url":"https://github.com/sitespeedio/chrome-har","commit_stats":{"total_commits":207,"total_committers":15,"mean_commits":13.8,"dds":"0.46376811594202894","last_synced_commit":"27af78b876832a34aa6bd5bec82a2eb519ef3c7c"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fchrome-har","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fchrome-har/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fchrome-har/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fchrome-har/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitespeedio","download_url":"https://codeload.github.com/sitespeedio/chrome-har/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247446879,"owners_count":20940201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome","har"],"created_at":"2024-08-01T15:03:43.470Z","updated_at":"2025-04-06T12:05:39.895Z","avatar_url":"https://github.com/sitespeedio.png","language":"JavaScript","readme":"# Chrome-har\n\n![Unit tests](https://github.com/sitespeedio/chrome-har/workflows/Unit%20tests/badge.svg)\n\nCreate [HAR](http://www.softwareishard.com/blog/har-12-spec/) files based on [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) data.\n\nWe got tired of waiting for the +30K engineers at Google implementing a way to automate to get a HAR file [https://issues.chromium.org/issues/40809195](https://issues.chromium.org/issues/40809195) so we implemented our own solution in the mean time.\n\n\nCode originally extracted from [Browsertime](https://github.com/sitespeedio/browsertime), initial implementation inspired by [Chromedriver_har](https://github.com/woodsaj/chromedriver_har).\n\n## Create a new bug report\nMake 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`:\n\n```\n$ browsertime --chrome.collectPerfLog -n 1 https://www.sitespeed.io\n```\n\nThen 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.\n\n\nIf you use sitespeed.io:\n```\n$ sitespeed.io --browsertime.chrome.collectPerfLog -n 1 https://www.sitespeed.io\n```\n\n## Support for Response Bodies\n\nIf 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](https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Response) by the caller and if the `includeTextFromResponseBody` option is set to `true`.\n\nFor example:\n\n```javascript\nconst harEvents: Array\u003cany\u003e = [];\n\nclient.on('Network.requestIntercepted', async (params: any) =\u003e {\n  // Get the response body\n  const response = await client.send(\n    'Network.getResponseBodyForInterception',\n    { interceptionId: params.interceptionId },\n  );\n\n  // Set the body on the response object\n  if (params.response != null) {\n    params.response.body = response.body;\n  } else {\n    params.response = response;\n  }\n\n  // Continue the request\n  await client.send(\n    'Network.continueInterceptedRequest',\n    { interceptionId: params.interceptionId },\n  );\n\n  harEvents.push({ method, params });\n});\n\nconst har = harFromMessages(harEvents, {includeTextFromResponseBody: true});\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitespeedio%2Fchrome-har","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitespeedio%2Fchrome-har","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitespeedio%2Fchrome-har/lists"}