Skip to content

livePage

hc.livePage

Available since v2.0.0

ParameterTypeDescription
urlOptional. When set, opens or reuses a tab at that URL (new tabs wait for load). Omit to bind the active browser tab.
reuseOptional. Defaults to true — reuse an existing tab for the URL when possible. Pass false to always open a new tab.

Type: async factory — (url?: string, options?: { reuse?: boolean }) => Promise<LivePageHandle>

Opens or reuses an embedded browser tab and returns a handle for focus, close, navigation, DOM query/evaluate/inject, and screenshots. Disabled by default for request scripts. Enable Allow script live page access in Settings → General before calling this API.

Page load waits count against the same script timeout as other await calls in the script.

Handle helpers: navigate(url), goBack(), goForward(), and reload() wait for load and refresh url / title / canGoBack / canGoForward.

Saved live pages are the product surface for persistent browser sessions with settings and injection scripts. hc.livePage is the script/API surface for controlling tabs during a send. Plugins use the same API with the browser permission (not gated by Allow script live page access), and manage saved entities with hc.livePages (live-pages permission) — see SDK — Live page and SDK — Live pages for the full API.

javascript
const page = await hc.livePage("https://example.com");
await page.focus();
await page.navigate("https://example.com/docs");
await page.reload();
await page.goBack();
await page.goForward();
const heading = await page.dom.query("h1");
console.log(heading.matchCount, heading.elements);
const closed = await page.close();