{"id":15020897,"url":"https://github.com/loadmill/har-recorder","last_synced_at":"2025-10-26T16:30:43.303Z","repository":{"id":36471349,"uuid":"226865497","full_name":"loadmill/har-recorder","owner":"loadmill","description":"Capture HAR recordings from Chrome sessions or Selenium tests using Node.js","archived":false,"fork":false,"pushed_at":"2023-07-08T09:18:28.000Z","size":283,"stargazers_count":12,"open_issues_count":12,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T21:11:29.392Z","etag":null,"topics":["chrome-debugging-protocol","har","nodejs","selenium"],"latest_commit_sha":null,"homepage":"https://www.loadmill.com/","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/loadmill.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-12-09T12:25:40.000Z","updated_at":"2024-08-06T19:00:00.000Z","dependencies_parsed_at":"2024-09-23T09:02:07.076Z","dependency_job_id":"e83138fa-1de2-46db-b570-01a10e964ff4","html_url":"https://github.com/loadmill/har-recorder","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"91fd9a3aad343582aabaae954bee77d99bdb0649"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fhar-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fhar-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fhar-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loadmill%2Fhar-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loadmill","download_url":"https://codeload.github.com/loadmill/har-recorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238366693,"owners_count":19460170,"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-debugging-protocol","har","nodejs","selenium"],"created_at":"2024-09-24T19:55:49.367Z","updated_at":"2025-10-26T16:30:42.953Z","avatar_url":"https://github.com/loadmill.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# har-recorder\n\nUse this package to capture HAR recordings from Chrome sessions or Selenium tests.\n\nUsing the [Chrome Debugging Protocol](https://chromedevtools.github.io/devtools-protocol/) thorugh [chrome-remote-interface](https://github.com/cyrus-and/chrome-remote-interface) this pakcage listens to Chrome Fetch events and stores requests and reponses to HAR file.\n\n## Selenium usage example\n\n```javascript\nconst { startRecording, endRecording } = HarRecorder();\n\n// enable chrome remote debugging on port 9223\nlet chrome_options = new chrome.Options()\n    .addArguments(\"--remote-debugging-port=9223\");\n\ndriver = await new Builder()\n    .setChromeOptions(chrome_options)\n    .forBrowser('chrome')\n    .build();\n\n// start the recording on port 9223\nawait startRecording({ port: 9223 });\n\n// do Selenium stuff \nawait driver.navigate().to('https://www.google.com');\nawait driver.wait(until.elementLocated(By.name('q')));\n\n// save recording to file\nendRecording('create-blog-post.har');\ndriver.quit();    \n```\n\n## Installation\n\n    npm install har-recorder\n\n## Setup\n\nAn instance of either Chrome itself or another implementation needs to be\nrunning on a known port in order to use this module (defaults to\n`localhost:9222`).\n\n## API\n\nThe API consists of three parts:\n\n- The constructor function which creates a new HarRecorder.\n\n- `startRecording([options])` which starts recording a given Chrome instance. The recording defaults to\n`localhost:9222`. Overide this by passing a [CDP options object](https://github.com/cyrus-and/chrome-remote-interface/blob/master/README.md#cdpoptions-callback).\n\n- `endRecording(filePath)` which saves the HAR recording to a file and resets the stored requests.  \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadmill%2Fhar-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floadmill%2Fhar-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floadmill%2Fhar-recorder/lists"}