{"id":19738289,"url":"https://github.com/httptoolkit/mockrtc-extension-example","last_synced_at":"2025-10-13T03:11:16.932Z","repository":{"id":61312994,"uuid":"550381939","full_name":"httptoolkit/mockrtc-extension-example","owner":"httptoolkit","description":"An example web extension, using MockRTC to intercept \u0026 debug your own WebRTC traffic","archived":false,"fork":false,"pushed_at":"2022-10-12T17:19:09.000Z","size":140,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-17T03:06:38.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/httptoolkit.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":"2022-10-12T17:06:18.000Z","updated_at":"2024-11-06T03:45:08.000Z","dependencies_parsed_at":"2022-10-14T21:24:24.572Z","dependency_job_id":null,"html_url":"https://github.com/httptoolkit/mockrtc-extension-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/httptoolkit/mockrtc-extension-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httptoolkit%2Fmockrtc-extension-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httptoolkit%2Fmockrtc-extension-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httptoolkit%2Fmockrtc-extension-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httptoolkit%2Fmockrtc-extension-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/httptoolkit","download_url":"https://codeload.github.com/httptoolkit/mockrtc-extension-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/httptoolkit%2Fmockrtc-extension-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014167,"owners_count":26085369,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-12T01:13:48.424Z","updated_at":"2025-10-13T03:11:16.900Z","avatar_url":"https://github.com/httptoolkit.png","language":"TypeScript","readme":"# MockRTC WebExtension Example\n\n\u003e _Part of [HTTP Toolkit](https://httptoolkit.tech): powerful tools for building, testing \u0026 debugging HTTP(S), WebRTC, and more_\n\nThis is an example web extension you can use as a base to build your own WebRTC-intercepting web extensions for debugging.\n\nThis is a proof-of-concept example to start from, not something you'd immediately use out of the box. To intercept WebRTC using this repo:\n\n* Clone this repo\n* `npm install`\n* Modify the logic in [background.ts](https://github.com/httptoolkit/mockrtc-extension-example/blob/88344b382d244c04c022ba36ffb62e2cfe412ddc/src/background.ts#L23-L32) to configure MockRTC however you'd like\n* Launch the extension\n    * You may be able to run `npm start` to launch a MockRTC backend, build the code in this repo into a usable web extension, and open a new Chrome window with that extension temporarily installed.\n    * Or this may fail, if you don't have Chrome in your PATH as `google-chrome`, if you're using Windows, if Chrome is already running, or probably in various other cases.\n    * As an alternative, you can run `npm run start:backend`, and then install the extension manually in any Chromium-based browser by going to `chrome://extensions/`, enabling developer mode, clicking 'Load unpacked' and then selecting the `public` folder in this repo on your machine.\n    * Should also work in Safari \u0026 Firefox and anywhere else supporting web extensions, although I haven't tested.\n* Test it on the official samples at https://webrtc.github.io/samples/, for example:\n    * Go to `chrome://extensions` and click the 'service worker' link on the MockRTC extension open the console for your extension.\n    * Open https://webrtc.github.io/samples/src/content/datachannel/messaging/ for a convenient chat demo.\n    * Click connect, which will open two MockRTC connections in that one page, connected together.\n    * Send a message in either direction - you'll see 'Sent: X' \u0026 'Received: X' (from the two connections) appear in your extension console.\n\nOnce you've got the basics working, you can extend the code in `background.ts` to monitor any WebRTC events or define any rules you'd like to do anything you're interested in. If you run into limitations in MockRTC and there's more capabilities you need there, [please open an issue](https://github.com/httptoolkit/mockrtc/issues/new).\n\n---\n\n_This‌ ‌project‌ ‌has‌ ‌received‌ ‌funding‌ ‌from‌ ‌the‌ ‌European‌ ‌Union’s‌ ‌Horizon‌ ‌2020‌‌ research‌ ‌and‌ ‌innovation‌ ‌programme‌ ‌within‌ ‌the‌ ‌framework‌ ‌of‌ ‌the‌ ‌NGI-POINTER‌‌ Project‌ ‌funded‌ ‌under‌ ‌grant‌ ‌agreement‌ ‌No‌ 871528._\n\n![The NGI logo and EU flag](./ngi-eu-footer.png)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttptoolkit%2Fmockrtc-extension-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhttptoolkit%2Fmockrtc-extension-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhttptoolkit%2Fmockrtc-extension-example/lists"}