SDK Reference
Utilities
Tabs, cookies, keyboard, and element info methods.
Tabs
tabs
tabs(): Promise<TabInfo[]>
List all open tabs.
const allTabs = await opensteer.tabs()
newTab
newTab(url?: string): Promise<void>
Open a new tab.
switchTab
switchTab(index: number): Promise<void>
Switch to a tab by index.
closeTab
closeTab(index?: number): Promise<void>
Close a tab. Defaults to the current tab.
Cookies
getCookies
getCookies(url?: string): Promise<CookieParam[]>
Get cookies for the current page or a specific URL.
setCookie
setCookie(cookie: CookieParam): Promise<void>
Set a cookie.
clearCookies
clearCookies(): Promise<void>
Clear all cookies.
exportCookies
exportCookies(filePath: string, url?: string): Promise<void>
Export cookies to a JSON file. Local only.
importCookies
importCookies(filePath: string): Promise<void>
Import cookies from a JSON file. Local only.
Keyboard
pressKey
pressKey(key: string): Promise<void>
Press a keyboard key.
await opensteer.pressKey('Enter')
await opensteer.pressKey('Escape')
type
type(text: string): Promise<void>
Type text character by character.
await opensteer.type('hello world')
Element Info
getElementText
getElementText(options: ElementOptions): Promise<string>
getElementValue
getElementValue(options: ElementOptions): Promise<string>
getElementAttributes
getElementAttributes(options: ElementOptions): Promise<Record<string, string>>
getElementBoundingBox
getElementBoundingBox(options: ElementOptions): Promise<BoundingBox>
const text = await opensteer.getElementText({ element: 5 })
const attrs = await opensteer.getElementAttributes({ selector: '#main' })
const box = await opensteer.getElementBoundingBox({ description: 'submit-button' })
