Real tabs the agent
can identify.
MASAKA exposes the browser’s actual WebDriver window handles, keeps the active page explicit, and resets preview after every tab transition.
Discover before switching
A fresh snapshot returns page content, tabs, and active_tab. Use tabs to refresh only the tab state. Each item includes an opaque handle, bounded title, URL, and active flag.
{
"tabs": [
{"handle":"page-one","title":"Search","url":"https://example.com/","active":true},
{"handle":"page-two","title":"Result","url":"https://example.org/","active":false}
],
"active_tab":"page-one"
}Mutate with observed handles
/api/sessions/:id/commands{"kind":"tab_new"}/api/sessions/:id/commands{"kind":"tab_switch","handle":"page-two"}/api/sessions/:id/commands{"kind":"tab_close","handle":"page-one"}All three require the current input capability. The last remaining tab cannot be closed.
Agent behavior
- 1Snapshot
Read current tabs and active handle.
- 2Choose an observed handle
Never infer or fabricate one from a title or URL.
- 3Switch once
Resolve the returned command receipt.
- 4Snapshot again
Verify active tab and newly rendered page before input.
Implementation guarantee
Tab operations call real WebDriver window/handles, window/new, window switch, and window delete commands. They do not simulate a tab by navigating one physical page to a stored URL.