SDK Reference
Tabs, Cookies, Keyboard, Element Info
Session-level browser control APIs for tabs, cookies, keyboard actions, and element inspection.
Tabs
tabs(): Promise<TabInfo[]>
List all open tabs with index, URL, title, and active status.
newTab(url?: string): Promise<TabInfo>
Open a new tab and optionally navigate to a URL. Switches the active page.
switchTab(index: number): Promise<void>
Switch to the tab at the given index.
closeTab(index?: number): Promise<void>
Close the tab at the given index, or the current tab if omitted.
Cookies
getCookies(url?: string): Promise<Cookie[]>
Get cookies, optionally filtered by URL.
setCookie(cookie: CookieParam): Promise<void>
Set a single cookie.
clearCookies(): Promise<void>
Clear all cookies in the browser context.
exportCookies(filePath: string, url?: string): Promise<void>
Export cookies to a JSON file. Not supported in cloud mode.
importCookies(filePath: string): Promise<void>
Import cookies from a JSON file. Not supported in cloud mode.
Keyboard
pressKey(key: string): Promise<void>
Press a keyboard key (e.g. 'Enter', 'Tab', 'Escape').
type(text: string): Promise<void>
Type text character-by-character into the currently focused element.
Element Info
getElementText(options: BaseActionOptions): Promise<string>
Get the text content of an element.
getElementValue(options: BaseActionOptions): Promise<string>
Get the input value of a form element.
getElementAttributes(options: BaseActionOptions): Promise<Record<string, string>>
Get all attributes of an element as a key-value map.
getElementBoundingBox(options: BaseActionOptions): Promise<BoundingBox | null>
Get the bounding box of an element, or null if not visible.
getHtml(selector?: string): Promise<string>
Get raw HTML of the page or a specific element by CSS selector.
getTitle(): Promise<string>
Get the page title.
Covered Features
sdk:clearCookiessdk:closeTabsdk:exportCookiessdk:getCookiessdk:getElementAttributessdk:getElementBoundingBoxsdk:getElementTextsdk:getElementValuesdk:importCookiessdk:newTabsdk:pressKeysdk:setCookiesdk:switchTabsdk:tabssdk:type
