MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / withTimeout

Function withTimeout

apps/extension/src/shared/tab-debugger.ts:683–704  ·  view source on GitHub ↗
(
  promise: Promise<Result>,
  timeoutMs: number
)

Source from the content-addressed store, hash-verified

681 title: title === undefined || title === '' ? tab.url : title,
682 url: tab.url,
683 };
684 });
685};
686
687const getTabId = (tab: BrowserTabInfo | undefined): number | undefined => tab?.id;
688
689export type InspectableTabResolution =
690 | {
691 readonly ok: true;
692 readonly tab: BrowserTabInfo | undefined;
693 }
694 | {
695 readonly error: string;
696 readonly ok: false;
697 };
698
699/**
700 * Reads the selected tab and refuses the browser-tool session when the tab is
701 * gone or is a browser-internal page the debugger cannot attach to. A tabs API
702 * without `get` (Firefox scripting path) cannot check, so it is treated as
703 * inspectable and the attach call reports any real failure.
704 */
705export const getInspectableTab = async ({
706 tabId,
707 tabsApi,

Callers 2

evalInTabWithScriptingFunction · 0.70

Calls 1

rejectFunction · 0.50

Tested by

no test coverage detected