请参考这儿:https://stackoverflow.com/questions/39190476/disable-reload-via-keyboard-shortcut-electron-app
Prevent BrowserWindow refreshes
A user can press Cmd+R (on macOS) or Ctrl+R/Ctrl+Shift+R/F5 (on Windows) to refresh the webpage shown by the BrowserWindow. True native applications don’t exhibit this behaviour.
The recommended solution is to replace the default menu to disable this behaviour. On Windows, you can call win.removeMenu(). On macOS, you can call Menu.setApplicationMenu(Menu.buildFromTemplate([])). You should only do it for production since you will lose access to DevTools.
For Kiosk Mode, another solution is to Disable the keyboard shortcuts when the BrowserWindow takes focus and then unregister the shortcuts when the BrowserWindow loses focus or is closed/hidden.
const electronLocalshortcut = require('electron-localshortcut')
win.on('focus', (event) => {
electronLocalshortcut.register(win, ['CommandOrControl+R','CommandOrControl+Shift+R', 'F5'], () => {})
})
win.on('blur', (event) => {
electronLocalshortcut.unregisterAll(win)
})