MCPcopy Create free account
hub / github.com/e2b-dev/desktop / screenshot

Method screenshot

packages/js-sdk/src/sandbox.ts:263–271  ·  view source on GitHub ↗
(format: 'bytes' | 'blob' | 'stream' = 'bytes')

Source from the content-addressed store, hash-verified

261 */
262 async screenshot(format: 'stream'): Promise<ReadableStream<Uint8Array>>
263 async screenshot(format: 'bytes' | 'blob' | 'stream' = 'bytes') {
264 const path = `/tmp/screenshot-${generateRandomString()}.png`
265 await this.commands.run(`scrot --pointer ${path}`)
266
267 // @ts-expect-error
268 const file = await this.files.read(path, { format })
269 this.files.remove(path)
270 return file
271 }
272
273 /**
274 * Left click on the mouse position.

Callers 1

screen.test.tsFile · 0.45

Calls 1

generateRandomStringFunction · 0.90

Tested by

no test coverage detected