javascript复制代码const{BrowserWindow,ipcMain}=require('electron')constpath=require('path')constisDevelopment=process.env.NODE_ENV==='development'letmainWindow=nullfunctioncreateMainWindow(){mainWindow=newBrowserWindow({width:1160,height:752,minHeight:632,minWidth:960,show:false,frame:false,title...
fullscreenWindowTitle Boolean (optional) - Shows the title in the title bar in full screen mode on macOS for all titleBarStyle options. 默认值为 false. thickFrame Boolean(可选)-对 Windows 上的无框窗口使用WS_THICKFRAME 样式,会增加标准窗口框架。 设置为 false 时将移除窗口的阴影和动画. 默认值...
mainWindow.loadFile('index.html') // Open DevTools - Remove for PRODUCTION! mainWindow.webContents.openDevTools(); // Listen for window being closed mainWindow.on('closed', () => { mainWindow = null }) electron.powerMonitor.on('resume', e => { if(!mainWindow) createWindow() }) ele...
mainWindow.loadFile('index.html') // Open DevTools - Remove for PRODUCTION! mainWindow.webContents.openDevTools(); // Listen for window being closed mainWindow.on('closed', () => { mainWindow = null }) electron.powerMonitor.on('resume', e => { if(!mainWindow) createWindow() }) ele...
frame: false,//通过设置frame的值为false可以隐藏窗口的边框。 // backgroundColor: '#DC143C', // titleBarStyle: 'hidden', webPreferences: { webSecurity: false, //Remove cross domain restrictions nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION, ...
(event: IpcRendererEvent, data: unknown[]) => void ) => Electron.IpcRenderer removeAllListeners: (channel: string) => Electron.IpcRenderer } } }</code></pre><p>一般把data定义的:<code>data: unknown[]</code>, 这个传输的时候,很难在主进程知道传入过来的是什么数据类型,这里...
menu.append(menuitemRemoveImage); panel.addEventListener("contextmenu",function(event){ event.preventDefault(); x=event.x; y=event.y; menu.popup({x:x,y:y}); return false; }); } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
remove typedoc Oct 30, 2020 app chore: remove code Jan 19, 2022 assets 菜单&图标优化 Feb 25, 2020 build fix: remove log color Jan 15, 2022 types feat: titlebar 配置优化 Jan 17, 2022 .eslintignore 升级到 webpack 5 Nov 23, 2020 ...
[Bug]: removeBrowserView() crashes if view.webContents.close() is called beforehand. #39377 Closed 3 tasks KevinLaity commented Sep 22, 2023 If you're developing an app and want to disable the alt menu shortcut, I've found this works: addEventListener("keydown", (e)=> { if (...
image.toPNG() fs.writeFile( app.getPath('desktop') + `/screenshot_${i}.png`, screenshot, console.log ) i++ }) mainWindow.webContents.on('did-finish-load', e => { console.log( mainWindow.getTitle() ) mainWindow.close() mainWindow = null }) // Open DevTools - Remove for ...