{"id":42671137,"url":"https://github.com/calibr/chrome-broadcaster","last_synced_at":"2026-01-29T11:00:04.173Z","repository":{"id":32009359,"uuid":"35580405","full_name":"calibr/chrome-broadcaster","owner":"calibr","description":"Broadcast messages in chrome extensions","archived":false,"fork":false,"pushed_at":"2017-01-01T14:45:05.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-20T23:52:19.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calibr.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-13T23:55:27.000Z","updated_at":"2023-08-20T23:52:19.789Z","dependencies_parsed_at":"2022-08-25T23:22:25.254Z","dependency_job_id":null,"html_url":"https://github.com/calibr/chrome-broadcaster","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/calibr/chrome-broadcaster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calibr%2Fchrome-broadcaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calibr%2Fchrome-broadcaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calibr%2Fchrome-broadcaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calibr%2Fchrome-broadcaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calibr","download_url":"https://codeload.github.com/calibr/chrome-broadcaster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calibr%2Fchrome-broadcaster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28876674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-29T11:00:02.044Z","updated_at":"2026-01-29T11:00:04.160Z","avatar_url":"https://github.com/calibr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Broadcast messages for Chrome Extensions\n\n## Why?\n\nSometimes you need to receive messages sent by chrome.runtime.sendMessage in the sender's frame, so you have something like this in your extesion page's js file:\n\n```js\n\nchrome.runtime.onMessage(function(message) {\n  ...\n});\n\n...\n\nchrome.runtime.sendMessage(...);\n\n```\n\nBut Chrome behaviour for this among versions and even inside a single version is inconsistent:\n\n- up to 57 onMessage listener within one frame will be triggered only if there are at least two extension's frames(`chrome.extension.getViews().length \u003e 1`)\n- in versions from 57 `onMessage` is not triggered within one frame in any case. *It is the expected behaviour.*\n\nFor further reading see:\n- https://bugs.chromium.org/p/chromium/issues/detail?id=677692\n- https://bugzilla.mozilla.org/show_bug.cgi?id=1286124#c35\n\n## Usage\n\nJust include `broadcaster.js` in your addon and replace:\n- `chrome.runtime.sendMessage` by `Broadcaster.sendMessage`\n- `chrome.runtime.onMessage` by `Broadcaster.onMessage`\n\nSending message:\n\n```javascript\n\n// simple\nBroadcaster.sendMessage({\"message\": 1});\n\n// with callback\nBroadcaster.sendMessage({\"message\": 1}, function(response) {\n});\n\n```\n\nReceiving message:\n\n\n```javascript\n\nBroadcaster.onMessage.addListener(function(message, sender, sendResponse) {\n\n});\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalibr%2Fchrome-broadcaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalibr%2Fchrome-broadcaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalibr%2Fchrome-broadcaster/lists"}