1const {getCurrentWindow, globalShortcut} = require('electron').remote;
2
3var reload = ()=>{
4 getCurrentWindow().reload()
5}
6
7globalShortcut.register('F5', reload);
8globalShortcut.register('CommandOrControl+R', reload);
9// here is the fix bug #3778, if you know alternative ways, please write them
10window.addEventListener('beforeunload', ()=>{
11 globalShortcut.unregister('F5', reload);
12 globalShortcut.unregister('CommandOrControl+R', reload);
13})