@@ -6,22 +6,18 @@ import { Sandbox } from '@e2b/desktop'
66const windowFrameHeight = 29
77
88app . on ( 'window-all-closed' , ( ) => {
9- if ( process . platform !== 'darwin' ) {
10- app . quit ( )
11- }
12- } )
13-
14- app . on ( 'activate' , ( ) => {
15- if ( BrowserWindow . getAllWindows ( ) . length === 0 ) {
16- console . log ( 'activate event received' )
17- createWindow ( )
18- }
9+ app . quit ( )
1910} )
2011
2112function wait ( ms ) {
2213 return new Promise ( resolve => setTimeout ( resolve , ms ) )
2314}
2415
16+ /**
17+ * @param {string } streamUrl - The URL of the stream to load
18+ * @param {number } width - The width of the window
19+ * @param {number } height - The height of the window
20+ */
2521async function createWindow ( streamUrl , width , height ) {
2622 const win = new BrowserWindow ( {
2723 title : 'E2B Desktop' ,
@@ -39,6 +35,11 @@ async function createWindow(streamUrl, width, height) {
3935 console . log ( ' - Stream URL loaded' )
4036}
4137
38+ /**
39+ * @param {import('@e2b/desktop').Sandbox } desktop - E2B desktop sandbox
40+ * @param {number } width - The width of the window
41+ * @param {number } height - The height of the window
42+ */
4243async function moveAround ( desktop , width , height ) {
4344 console . log ( '\n> Randomly moving mouse and right clicking 5 times...' )
4445 for ( let i = 0 ; i < 5 ; i ++ ) {
0 commit comments