navigateAndWait function application exported

Last updated: 2026-03-05T10:53:28.864Z

Metrics

LOC: 13 Complexity: 2 Params: 4

Signature

navigateAndWait( tabId: number, url: string, timeoutMs = 30_000, ): : Promise<boolean>

Summary

Navigate a tab to url and wait until the page is fully loaded.

Tags

#@returns true when the target URL is loaded, false on timeout.

Source Code

export async function navigateAndWait(
  tabId: number,
  url: string,
  timeoutMs = 30_000,
): Promise<boolean> {
  try {
    await chrome.tabs.update(tabId, { url });
    return await waitForTabLoad(tabId, timeoutMs);
  } catch (err) {
    log.warn(`Navigation to ${url} failed:`, err);
    return false;
  }
}

Dependencies (Outgoing)

graph LR navigateAndWait["navigateAndWait"] createLogger["createLogger"] waitForTabLoad["waitForTabLoad"] navigateAndWait -->|uses| createLogger navigateAndWait -->|calls| waitForTabLoad style navigateAndWait fill:#dbeafe,stroke:#2563eb,stroke-width:2px click navigateAndWait "915565f33bfb5777.html" click createLogger "70597a0a6b5e9ebb.html" click waitForTabLoad "f95e5c46991b38e7.html"
TargetType
createLogger uses
waitForTabLoad calls

Impact (Incoming)

graph LR navigateAndWait["navigateAndWait"] OrchestratorCallbacks["OrchestratorCallbacks"] executeNavigateStep["executeNavigateStep"] runLoop["runLoop"] OrchestratorCallbacks -->|uses| navigateAndWait executeNavigateStep -->|calls| navigateAndWait runLoop -->|calls| navigateAndWait style navigateAndWait fill:#dbeafe,stroke:#2563eb,stroke-width:2px click navigateAndWait "915565f33bfb5777.html" click OrchestratorCallbacks "984a6b93df2ea9af.html" click executeNavigateStep "b662d9614e361217.html" click runLoop "c94a70bb97b4ccad.html"
SourceType
OrchestratorCallbacks uses
executeNavigateStep calls
runLoop calls