Sandbox
Methods
doubleClick()
Returns
Promise
<CommandResult
>
getCursorPosition()
Returns
Promise
<object
>
An object with x
and y
coordinates.
Name | Type |
---|---|
x | number |
y | number |
getScreenSize()
Returns
Promise
<object
>
An object with width
and height
properties.
Name | Type |
---|---|
height | number |
width | number |
getVideoStreamUrl()
Returns
Promise
<string
>
hotkey()
Parameters
Parameter | Type | Description |
---|---|---|
…keys | string [] | The keys to press (e.g. hotkey("ctrl", "c") will press Ctrl+C). |
Returns
Promise
<CommandResult
>
leftClick()
Returns
Promise
<CommandResult
>
middleClick()
Returns
Promise
<CommandResult
>
moveMouse()
Parameters
Parameter | Type | Description |
---|---|---|
x | number | The x coordinate. |
y | number | The y coordinate. |
Returns
Promise
<CommandResult
>
open()
Parameters
Parameter | Type | Description |
---|---|---|
fileOrUrl | string | The file or URL to open. |
Returns
Promise
<CommandHandle
>
press()
Parameters
Parameter | Type | Description |
---|---|---|
key | string | The key to press (e.g. “enter”, “space”, “backspace”, etc.). |
Returns
Promise
<CommandResult
>
rightClick()
Returns
Promise
<CommandResult
>
runPyautoguiCode()
Parameters
Parameter | Type |
---|---|
code | string |
opts | object |
opts.onStderr ? | (data : string ) => void |
opts.onStdout ? | (data : string ) => void |
Returns
Promise
<CommandResult
>
scroll()
Parameters
Parameter | Type | Description |
---|---|---|
amount | number | The amount to scroll. |
Returns
Promise
<CommandResult
>
takeScreenshot()
takeScreenshot()
Returns
Promise
<Uint8Array
>
A Uint8Array bytes representation of the screenshot.
takeScreenshot(format)
Parameters
Parameter | Type | Description |
---|---|---|
format | "bytes" | The format of the screenshot. |
Returns
Promise
<Uint8Array
>
A Uint8Array bytes representation of the screenshot.
takeScreenshot(format)
Parameters
Parameter | Type |
---|---|
format | "blob" |
Returns
Promise
<Blob
>
A Blob representation of the screenshot.
takeScreenshot(format)
Parameters
Parameter | Type |
---|---|
format | "stream" |
Returns
Promise
<ReadableStream
<Uint8Array
>>
A ReadableStream of bytes representation of the screenshot.
write()
Parameters
Parameter | Type | Description |
---|---|---|
text | string | The text to write. |
Returns
Promise
<CommandResult
>
create()
create(this, opts)
desktop
sandbox template.
Type Parameters
Type Parameter |
---|
S extends typeof Sandbox |
Parameters
Parameter | Type | Description |
---|---|---|
this | S | - |
opts ? | SandboxOpts | connection options. |
Returns
Promise
<InstanceType
<S
>>
sandbox instance for the new sandbox.
Example
Constructs
Sandboxcreate(this, template, opts)
Type Parameters
Type Parameter |
---|
S extends typeof Sandbox |
Parameters
Parameter | Type | Description |
---|---|---|
this | S | - |
template | string | sandbox template name or ID. |
opts ? | SandboxOpts | connection options. |
Returns
Promise
<InstanceType
<S
>>
sandbox instance for the new sandbox.
Example
Constructs
SandboxInterfaces
SandboxOpts
Properties
onVideoStreamStart()?
Parameters
Parameter | Type |
---|---|
url | string |
Returns
void