escrcpy/electron/ipc/app/index.js
2024-10-21 17:40:28 +08:00

20 lines
419 B
JavaScript

import { app, BrowserWindow, ipcMain } from 'electron'
export default () => {
ipcMain.on('restart-app', () => {
app.isQuiting = true
app.relaunch()
app.quit()
})
ipcMain.on('close-active-window', (event) => {
const win = BrowserWindow.getFocusedWindow()
win.close()
})
ipcMain.on('hide-active-window', (event) => {
const win = BrowserWindow.getFocusedWindow()
win.hide()
})
}