import { app , BrowserWindow , dialog } from "electron" ; import path from "path" ; app . commandLine . appendSwitch ( "in-process-gpu" ) ; app . on ( "window-all-closed" , ( ) => { app . quit ( ) ; } ) ; app . on ( "ready" , ( ) => { if ( process . argv . length > 1 ) { if ( process . argv [ 1 ] === "/p" ) { app . quit ( ) ; return ; } if ( ( process . argv [ 1 ] === "/S" ) || process . argv [ 1 ] . match ( /^\/c/ ) ) { dialog . showMessageBox ( { message : "This screen saver has no options that you can set." , buttons : [ "OK" ] } ) ; app . quit ( ) ; return ; } } const mainWindow = new BrowserWindow ( { show : false , autoHideMenuBar : true , backgroundColor : "#000" , webPreferences : { preload : path . join ( __dirname , "preload.js" ) } , } ) ; setTimeout ( ( ) => { mainWindow ! . loadFile ( "index.html" ) ; mainWindow ! . setKiosk ( true ) ; mainWindow ! . setAlwaysOnTop ( true ) ; mainWindow ! . show ( ) ; } , 3000 ) ; } ) ;