Skip to main content

Sandbox

Methods

doubleClick()

Double left click on the current mouse position.
Returns
Promise<CommandResult>

getCursorPosition()

Get the current mouse position.
Returns
Promise<object> An object with x and y coordinates.

getScreenSize()

Get the current screen size.
Returns
Promise<object> An object with width and height properties.

getVideoStreamUrl()

Returns
Promise<string>

hotkey()

Press a hotkey.
Parameters
Returns
Promise<CommandResult>

leftClick()

Left click on the current mouse position.
Returns
Promise<CommandResult>

middleClick()

Middle click on the current mouse position.
Returns
Promise<CommandResult>

moveMouse()

Move the mouse to the given coordinates.
Parameters
Returns
Promise<CommandResult>

open()

Open a file or a URL in the default application. Note that you’ll need to wait for the application to be opened.
Parameters
Returns
Promise<CommandHandle>

press()

Press a key.
Parameters
Returns
Promise<CommandResult>

rightClick()

Right click on the current mouse position.
Returns
Promise<CommandResult>

runPyautoguiCode()

Run the given Python code that uses pyautogui.
Parameters
Returns
Promise<CommandResult>

scroll()

Scroll the mouse wheel by the given amount.
Parameters
Returns
Promise<CommandResult>

takeScreenshot()

takeScreenshot()
Take a screenshot and save it to the given name.
Returns
Promise<Uint8Array> A Uint8Array bytes representation of the screenshot.
takeScreenshot(format)
Take a screenshot and save it to the given name.
Parameters
Returns
Promise<Uint8Array> A Uint8Array bytes representation of the screenshot.
takeScreenshot(format)
Take a screenshot and save it to the given name.
Parameters
Returns
Promise<Blob> A Blob representation of the screenshot.
takeScreenshot(format)
Take a screenshot and save it to the given name.
Parameters
Returns
Promise<ReadableStream<Uint8Array>> A ReadableStream of bytes representation of the screenshot.

write()

Write the given text at the current cursor position.
Parameters
Returns
Promise<CommandResult>

create()

create(this, opts)
Create a new sandbox from the default desktop sandbox template.
Type Parameters
Parameters
Returns
Promise<InstanceType<S>> sandbox instance for the new sandbox.
Example
Constructs
Sandbox
create(this, template, opts)
Create a new sandbox from the specified sandbox template.
Type Parameters
Parameters
Returns
Promise<InstanceType<S>> sandbox instance for the new sandbox.
Example
Constructs
Sandbox

Interfaces

SandboxOpts

Properties

onVideoStreamStart()?

Parameters
Returns
void

videoStream?