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)
| Target | Type |
|---|---|
| sendToTab | calls |
| sendToTabWithInjection | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| setupContextMenu | uses |
| handleMessage | uses |