Skip to navigation

Activate page

View as Markdown

Make a page the active page for browser Tools and Agent actions. A Runtime can have several pages, but only one page is active at a time.

Activate a page

const page = await bctrl.tools.call("browser.pages.activate", {
pageId,
}, { runtimeId: runtime.id });
console.log(page.id, page.active);

The Runtime must be active. The page must already exist in that Runtime.

Request parameters

ParameterTypeRequiredDescription
pageIdPageIdYesPage to make active.

Response

FieldTypeAlways presentDescription
idPageIdYesIdentifier of the activated page.
urlstringYesCurrent page URL.
titlestringYesCurrent page title.
activebooleanYestrue for the activated page.

Run asynchronously

const call = await bctrl.tools.start("browser.pages.activate", {
pageId,
}, { runtimeId: runtime.id });
const page = await bctrl.toolCalls.result(call.id, {
waitSeconds: 30,
});

Next