{"id":13799479,"url":"https://github.com/shyiko/electron-har","last_synced_at":"2025-09-03T04:39:28.358Z","repository":{"id":57221681,"uuid":"47726797","full_name":"shyiko/electron-har","owner":"shyiko","description":"A command-line tool for generating HTTP Archive (HAR) (based on Electron)","archived":false,"fork":false,"pushed_at":"2018-12-18T06:07:20.000Z","size":74,"stargazers_count":47,"open_issues_count":8,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-10T10:50:51.917Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/electron-har","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/shyiko.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}},"created_at":"2015-12-09T23:58:28.000Z","updated_at":"2024-02-26T19:29:16.000Z","dependencies_parsed_at":"2022-08-29T04:10:13.423Z","dependency_job_id":null,"html_url":"https://github.com/shyiko/electron-har","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Felectron-har","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Felectron-har/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Felectron-har/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Felectron-har/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shyiko","download_url":"https://codeload.github.com/shyiko/electron-har/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225190587,"owners_count":17435444,"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":[],"created_at":"2024-08-04T00:01:03.190Z","updated_at":"2024-11-18T14:30:33.667Z","avatar_url":"https://github.com/shyiko.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":["Using Electron"],"readme":"# electron-har\n\nA command-line tool for generating [HTTP Archive (HAR)](http://www.softwareishard.com/blog/har-12-spec/) (based on [Electron](http://electron.atom.io/)).\n\nThe data you get is identical to \"Chromium -\u003e Developer Tools -\u003e Network pane -\u003e Save All as HAR\".\n\n## Installation\n\nPrebuilt binaries can be found on the [release(s)](https://github.com/shyiko/electron-har/releases) page.\n\nYou can also use [npm](https://www.npmjs.com/):\n\n```sh\nnpm install -g electron-har\n```\n\n\u003e In order for Electron to work on Debian/Ubuntu (specifically on Debian 8/Ubuntu 12.04)\nfollowing packages have to be installed `libgtk2.0-0 libgconf-2-4 libasound2 libxtst6 libxss1 libnss3`.\n\n\n## Usage\n\n\u003e **NOTE** for Linux users: you might need to --disable-gpu\n\n```sh\n# NOTE: on Linux --disable-gpu might be needed\nelectron-har http://google.com # writes HAR to stdout\n\n# in case something doesn't look right / not working\nELECTRON_ENABLE_LOGGING=1 electron-har --disable-gpu --show http://google.com 2\u003eelectron.log\n\n# in a headless environment (CI agent on Linux?) - xvfb-run will do just fine \nDISPLAY=:1 xvfb-run electron-har http://google.com -o google_com.har\n\n# to see a complete list of command line options\nelectron-har --help\n```\n\n... or **pragmatically**\n\n```js\nconst electronHAR = require('electron-har')\n\nelectronHAR('http://enterprise.com/self-destruct', {\n  user: {\n    name: 'jean_luc_picard',\n    password: 'picard_4_7_alpha_tango'\n  }\n}, function (err, json) {\n  if (err) {\n    throw err\n  }\n  console.log(json.log.entries)\n})\n```\n\nIn a headless environment you might want to use [kesla/headless](https://github.com/kesla/node-headless) (which will start Xvfb for you). \n\n```js\nconst headless = require('headless')\nconst electronHAR = require('electron-har')\n\n(function (cb) {\n  if (!process.env.DISPLAY) {\n    headless(function (err, proc, display) {\n      if (err) {\n        return cb(err)\n      }\n      process.env.DISPLAY = ':' + display\n      cb(null, proc)\n    })\n  } else {\n    process.nextTick(cb)\n  }\n})(function (err, xvfb) {\n  if (err) {\n    throw err\n  }\n  electronHAR(..., function (err, json) {\n    ...\n    xvfb \u0026\u0026 xvfb.kill()\n  })\n})\n```\n\n## License\n\n[MIT License](https://github.com/shyiko/electron-har/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshyiko%2Felectron-har","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshyiko%2Felectron-har","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshyiko%2Felectron-har/lists"}