@@ -2,8 +2,9 @@ const { app, BrowserWindow, shell, ipcMain } = require('electron');
22const path = require ( 'path' ) ;
33const keytar = require ( 'keytar' ) ;
44const { autoUpdater } = require ( 'electron-updater' ) ;
5+ const contextMenu = require ( 'electron-context-menu' ) ;
56
6- function createWindow ( dir = '' ) {
7+ function createWindow ( ) {
78 const win = new BrowserWindow ( {
89 webPreferences : {
910 nodeIntegration : false ,
@@ -25,6 +26,16 @@ function createWindow(dir = '') {
2526 }
2627 } ) ;
2728 } ) ;
29+
30+ contextMenu ( {
31+ window : win ,
32+ showLookUpSelection : false ,
33+ showSearchWithGoogle : false ,
34+ append : ( actions , params , window ) => [ {
35+ label : 'Toggle fullscreen' ,
36+ click : ( ) => win . setFullScreen ( ! win . isFullScreen ( ) ) ,
37+ } ] ,
38+ } ) ;
2839
2940 win . loadURL ( 'https://undercards.net/SignIn' ) ;
3041 win . setMenu ( null ) ;
@@ -34,8 +45,6 @@ function createWindow(dir = '') {
3445 if ( input . control && input . shift && input . key . toLowerCase ( ) === 'i' ) {
3546 event . preventDefault ( ) ;
3647 win . webContents . openDevTools ( ) ;
37- } else if ( input . key === 'F11' ) {
38- win . setFullScreen ( ! win . isFullScreen ( ) ) ;
3948 } else if ( input . key === 'F5' || input . control && input . key . toLowerCase ( ) === 'r' ) {
4049 win . reload ( ) ;
4150 }
@@ -73,4 +82,4 @@ app.on('window-all-closed', () => {
7382} ) ;
7483
7584
76- module . exports = ( dir ) => app . whenReady ( ) . then ( ( ) => createWindow ( dir ) ) ;
85+ module . exports = ( ) => app . whenReady ( ) . then ( ( ) => createWindow ( ) ) ;
0 commit comments