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

1const page = await bctrl.tools.call("browser.pages.activate", {
2 pageId,
3}, { runtimeId: runtime.id });
4
5console.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

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

Next