(tabId: number | undefined, action: () => Promise<T>)
| 507 | } |
| 508 | |
| 509 | async function withTab<T>(tabId: number | undefined, action: () => Promise<T>): Promise<T> { |
| 510 | if (!Number.isFinite(tabId)) return await action(); |
| 511 | await agentCommand("tab_switch", { index: tabId }); |
| 512 | return await action(); |
| 513 | } |
| 514 | |
| 515 | async function agentEvaluate(script: string): Promise<any> { |
| 516 | const data = await agentCommand("evaluate", { script }); |
no test coverage detected