Skip to content

Pages API

Each session can have multiple pages (browser tabs). By default, commands operate on the last (most recently active) page.

List pages

GET /pages/{sid}

Response:

{
"pages": [
{"index": 0, "url": "https://example.com"},
{"index": 1, "url": "https://github.com"}
]
}

New page

POST /pages/{sid}/new
{"url": "https://github.com"}

url is optional — omit to open a blank page.

Response:

{"index": 1, "url": "https://github.com/"}

Close page

POST /pages/{sid}/close?index=<n>

index is optional — omits closes the last page.

Response: {"closed": 1}


Switch page

POST /pages/{sid}/switch
{"index": 0}

Switches the active page (subsequent commands operate on this page).

Response:

{"active": 0, "url": "https://example.com"}