11const path = require ( 'path' ) ;
2+ const fs = require ( 'fs' ) ;
23const { app, BrowserWindow, screen, Menu } = require ( 'electron' )
34
45Menu . setApplicationMenu ( null )
56if ( process . argv . includes ( '--portable' ) ) app . setPath ( 'userData' , path . join ( __dirname , 'data' ) ) ;
7+ if ( ! process . argv . includes ( '--vsync' ) ) {
8+ app . commandLine . appendSwitch ( 'disable-frame-rate-limit' ) ;
9+ app . commandLine . appendSwitch ( 'disable-gpu-vsync' ) ;
10+ }
611
712const createWindow = ( ) => {
8- const primaryDisplay = screen . getPrimaryDisplay ( )
9- const { width, height } = primaryDisplay . workAreaSize
13+ const primaryDisplay = screen . getPrimaryDisplay ( ) ;
14+ const { width, height } = primaryDisplay . workAreaSize ;
1015
1116 const win = new BrowserWindow ( {
1217 width : Math . floor ( width * 0.85 ) ,
@@ -17,12 +22,18 @@ const createWindow = () => {
1722 nodeIntegration : false ,
1823 experimentalFeatures : true
1924 }
20- } )
25+ } ) ;
2126
2227 win . setMenuBarVisibility ( false ) ;
2328 win . setAutoHideMenuBar ( true ) ;
2429
25- win . loadURL ( 'https://webmc.xyz/?plaf=desktop' ) ;
30+ win . loadURL ( 'https://app.webmc.xyz/?plaf=desktop' ) ;
31+
32+ win . webContents . on ( 'did-finish-load' , ( ) => {
33+ const cssPath = path . join ( __dirname , 'inject.css' ) ;
34+ const css = fs . readFileSync ( cssPath , 'utf8' ) ;
35+ win . webContents . insertCSS ( css ) . catch ( err => console . error ( 'CSS injection failed:' , err ) ) ;
36+ } ) ;
2637}
2738
2839app . whenReady ( ) . then ( ( ) => {
0 commit comments