屏蔽 F11 进入/退出全屏功能

This commit is contained in:
叶志超
2021-12-24 10:53:41 +08:00
parent 6ed9ebc1f6
commit c0c41f8fa5
2 changed files with 8 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { app, BrowserWindow } from 'electron'
import { app, globalShortcut, BrowserWindow } from 'electron'
import { join } from "path"
function createWindow() {
@@ -19,7 +19,12 @@ function createWindow() {
}
}
app.whenReady().then(createWindow)
app.whenReady().then(() => {
createWindow()
// 屏蔽 F11 进入/退出全屏功能
globalShortcut.register('F11', () => {return})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {