{"id":13941121,"url":"https://github.com/firefox-devtools/har-export-trigger","last_synced_at":"2025-05-01T07:32:07.293Z","repository":{"id":39534883,"uuid":"116956064","full_name":"firefox-devtools/har-export-trigger","owner":"firefox-devtools","description":"Trigger HAR export any time directly from within a page. ","archived":false,"fork":false,"pushed_at":"2019-03-28T20:06:26.000Z","size":42,"stargazers_count":55,"open_issues_count":24,"forks_count":14,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-06T11:11:22.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://addons.mozilla.org/en-US/firefox/addon/har-export-trigger/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firefox-devtools.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":"2018-01-10T12:40:37.000Z","updated_at":"2025-03-22T10:32:54.000Z","dependencies_parsed_at":"2022-09-20T03:53:59.422Z","dependency_job_id":null,"html_url":"https://github.com/firefox-devtools/har-export-trigger","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefox-devtools%2Fhar-export-trigger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefox-devtools%2Fhar-export-trigger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefox-devtools%2Fhar-export-trigger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firefox-devtools%2Fhar-export-trigger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firefox-devtools","download_url":"https://codeload.github.com/firefox-devtools/har-export-trigger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251840350,"owners_count":21652324,"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-08T02:01:11.644Z","updated_at":"2025-05-01T07:32:07.066Z","avatar_url":"https://github.com/firefox-devtools.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# HARExportTrigger\r\nTrigger HAR export any time directly from within a page.\r\n\r\nWebExtension improving automated HAR (HTTP Archive) export of collected data from the Network panel. This extension is built on top of WebExtensions DevTools API (compatible with Firefox and Chrome).\r\n\r\nThe extension exports HAR API directly to the page. Any automated system can be consequently built on top of the API and trigger HAR export using a simple JavaScript call at any time. It can be also nicely integrated with e.g. Selenium to implement automated HAR export robots for existing automated test suites.\r\n\r\n## Installation\r\nDownload from [AMO](https://addons.mozilla.org/en-US/firefox/addon/har-export-trigger/)\r\n\r\nOr you can also install it from source:\r\n1. Clone or download source code in this repository to your machine.\r\n2. Launch [Firefox Nightly](https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly) and open `about:debugging` page\r\n3. Click `Load Temporary Add-on` and pick any file from the root source code directory (e.g. `manifest.json`\r\n4. Re-open an existing DevTools Toolbox to make sure the extension is properly loaded by Firefox DevTools.\r\n\r\nYou might also use `web-ext` command line tool. Read more on [MDN](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext).\r\n\r\n## Directory Structure\r\nQuick description of the directory structure in this project.\r\n\r\n* `src` - source files\r\n* `res` - icons, styles, etc.\r\n* `lib` - HAR client API files\r\n\r\n## Requirements\r\nYou need Firefox 61+ to run this extension.\r\n\r\nThe following Firefox bugs are related:\r\n* [~~Bug 1311177~~](https://bugzilla.mozilla.org/show_bug.cgi?id=1311177) - (fixed in Firefox 60) Implement the devtools.network.getHAR API method\r\n* [~~Bug 1311171~~](https://bugzilla.mozilla.org/show_bug.cgi?id=1311171) - (fixed in Firefox 60) Implement the devtools.network.onRequestFinished API event\r\n* [~~Bug 1436665~~](https://bugzilla.mozilla.org/show_bug.cgi?id=1436665) - (fixed in Firefox 61) onRequestFinished event should be sent even if the Netmonitor UI isn't initialized\r\n* [~~Bug 1434855~~](https://bugzilla.mozilla.org/show_bug.cgi?id=1434855) - (fixed in Firefox 60) HAR export is very slow\r\n\r\n## Scopes\r\nThere are following scopes related to the architecture of this extension.\r\n\r\n1) Page scope - This is where your page is running. This scope also includes\r\n                harapi.js file (see lib dir in this repo) and eg triggers HAR export.\r\n2) Content scope - This scope is responsible for handling messages from the page\r\n                   and communicating with the DevTools scope.\r\n3) Background scope - Background scope is responsible for relaying messages\r\n                      between Content and Devtools scopes.\r\n4) Devtools scope - This scope is responsible for accessing DevTools\r\n                    WebExtension API and sending results back to content scope.\r\n\r\n## How To Use\r\nInstall the extension into your browser (Firefox \u0026 Chrome supported).\r\nHAR API implemented in `harapi.js` file is automatically injected\r\ninto your page (the file is available in `lib` directory in this repo).\r\n\r\nAn example script looks like as follows:\r\n\r\n```\r\nHAR.triggerExport().then(harLog =\u003e {\r\n  console.log(harLog);\r\n});\r\n\r\nHAR.addRequestListener(harEntry =\u003e {\r\n  console.log(\"Request finished\", request);\r\n});\r\n\r\n```\r\n\r\nSee also online [test page](http://softwareishard.com/test/harexporttrigger/).\r\n\r\n## Further Resources\r\n* Test page for HARExportTrigger: http://softwareishard.com/test/harexporttrigger/\r\n* HAR Spec: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HAR/Overview.html\r\n* HAR Spec (original): http://www.softwareishard.com/blog/har-12-spec/\r\n* HTTP Archive Viewer: http://www.softwareishard.com/blog/har-viewer/\r\n* HAR Discussion Group: http://groups.google.com/group/http-archive-specification/\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirefox-devtools%2Fhar-export-trigger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirefox-devtools%2Fhar-export-trigger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirefox-devtools%2Fhar-export-trigger/lists"}