MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / sendToContentScript

Function sendToContentScript

background/tab-runtime.js:528–547  ·  view source on GitHub ↗
(source, message, options = {})

Source from the content-addressed store, hash-verified

526 }
527
528 async function sendToContentScript(source, message, options = {}) {
529 throwIfStopped();
530 const { responseTimeoutMs = getContentScriptResponseTimeoutMs(message) } = options;
531 const registry = await getTabRegistry();
532 const entry = registry[source];
533
534 if (!entry || !entry.ready) {
535 throwIfStopped();
536 return queueCommand(source, message);
537 }
538
539 const alive = await isTabAlive(source);
540 throwIfStopped();
541 if (!alive) {
542 return queueCommand(source, message);
543 }
544
545 throwIfStopped();
546 return sendTabMessageWithTimeout(entry.tabId, source, message, responseTimeoutMs);
547 }
548
549 async function sendToContentScriptResilient(source, message, options = {}) {
550 const { timeoutMs = 30000, retryDelayMs = 600, logMessage = '' } = options;

Callers 9

fetchDuckEmailFunction · 0.70
submitVerificationCodeFunction · 0.70
requestSub2ApiOAuthUrlFunction · 0.70
executeStep5Function · 0.50
executeStep3Function · 0.50
executeSub2ApiStep9Function · 0.50

Calls 6

getTabRegistryFunction · 0.70
queueCommandFunction · 0.70
isTabAliveFunction · 0.70
throwIfStoppedFunction · 0.50

Tested by

no test coverage detected