MCPcopy Create free account
hub / github.com/garrytan/gstack / notifyContentScripts

Function notifyContentScripts

extension/background.js:117–130  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

115}
116
117async function notifyContentScripts(type) {
118 try {
119 const tabs = await chrome.tabs.query({});
120 for (const tab of tabs) {
121 if (tab.id) {
122 chrome.tabs.sendMessage(tab.id, { type }).catch(() => {
123 // Expected: tabs without content script
124 });
125 }
126 }
127 } catch (err) {
128 console.error('[gstack bg] Failed to query tabs for notification:', err.message);
129 }
130}
131
132// ─── Command Proxy ─────────────────────────────────────────────
133

Callers 2

setConnectedFunction · 0.85
setDisconnectedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected