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

Function createWindow

examples/basic-javascript/index.js:21–36  ·  view source on GitHub ↗

* @param {string} streamUrl - The URL of the stream to load * @param {number} width - The width of the window * @param {number} height - The height of the window

(streamUrl, width, height)

Source from the content-addressed store, hash-verified

19 * @param {number} height - The height of the window
20 */
21async function createWindow(streamUrl, width, height) {
22 const win = new BrowserWindow({
23 title: 'E2B Desktop',
24 width,
25 height: height + windowFrameHeight,
26 webPreferences: {
27 nodeIntegration: false,
28 contextIsolation: true,
29 webviewTag: true,
30 },
31 })
32
33 console.log('> Loading stream URL...')
34 await win.loadURL(streamUrl)
35 console.log(' - Stream URL loaded')
36}
37
38/**
39 * @param {import('@e2b/desktop').Sandbox} desktop - E2B desktop sandbox

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected