sendToSpecificTab function test exported ✓ 100.0%

Last updated: 2026-02-24T21:07:57.586Z

Metrics

LOC: 11 Complexity: 2 Params: 5 Coverage: 100.0% (3/3 lines, 3x executed)

Signature

sendToSpecificTab( tabId: number, tabUrl: string | undefined, message: ExtensionMessage, options: ActiveTabMessageOptions = {}, ): : Promise<unknown>

Summary

Sends a message to a specific tab by ID. Optionally injects the content script if it’s not yet loaded.

Source Code

export async function sendToSpecificTab(
  tabId: number,
  tabUrl: string | undefined,
  message: ExtensionMessage,
  options: ActiveTabMessageOptions = {},
): Promise<unknown> {
  if (!options.injectIfNeeded) {
    return sendToTab(tabId, tabUrl, message);
  }
  return sendToTabWithInjection(tabId, tabUrl, message);
}

Dependencies (Outgoing)

graph LR sendToSpecificTab["sendToSpecificTab"] sendToTab["sendToTab"] sendToTabWithInjection["sendToTabWithInjection"] sendToSpecificTab -->|calls| sendToTab sendToSpecificTab -->|calls| sendToTabWithInjection style sendToSpecificTab fill:#dbeafe,stroke:#2563eb,stroke-width:2px click sendToSpecificTab "3da88adecaec2d24.html" click sendToTab "4b0c8d5eae39e1ff.html" click sendToTabWithInjection "c1233e42257a3186.html"
TargetType
sendToTab calls
sendToTabWithInjection calls

Impact (Incoming)

graph LR sendToSpecificTab["sendToSpecificTab"] setupContextMenu["setupContextMenu"] handleMessage["handleMessage"] setupContextMenu -->|uses| sendToSpecificTab handleMessage -->|uses| sendToSpecificTab style sendToSpecificTab fill:#dbeafe,stroke:#2563eb,stroke-width:2px click sendToSpecificTab "3da88adecaec2d24.html" click setupContextMenu "2ffc26e0cf740034.html" click handleMessage "58fadf6b36b326d5.html"
SourceType
setupContextMenu uses
handleMessage uses