From 5bc4a5c2992849ec264d1843abde9917277cd774 Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Wed, 15 Jul 2020 11:01:58 +0530 Subject: [PATCH] silence electron remote module warning --- app/ui/window.ts | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/app/ui/window.ts b/app/ui/window.ts index 6793e325..69006803 100644 --- a/app/ui/window.ts +++ b/app/ui/window.ts @@ -24,27 +24,25 @@ export function newWindow( const classOpts = Object.assign({uid: uuidv4()}); app.plugins.decorateWindowClass(classOpts); - const winOpts = Object.assign( - { - minWidth: 370, - minHeight: 190, - backgroundColor: toElectronBackgroundColor(cfg.backgroundColor || '#000'), - titleBarStyle: 'hiddenInset', - title: 'Hyper.app', - // we want to go frameless on Windows and Linux - frame: process.platform === 'darwin', - transparent: process.platform === 'darwin', - icon, - show: process.env.HYPER_DEBUG || process.env.HYPERTERM_DEBUG || isDev, - acceptFirstMouse: true, - webPreferences: { - nodeIntegration: true, - navigateOnDragDrop: true - } + const winOpts: BrowserWindowConstructorOptions = { + minWidth: 370, + minHeight: 190, + backgroundColor: toElectronBackgroundColor(cfg.backgroundColor || '#000'), + titleBarStyle: 'hiddenInset', + title: 'Hyper.app', + // we want to go frameless on Windows and Linux + frame: process.platform === 'darwin', + transparent: process.platform === 'darwin', + icon, + show: Boolean(process.env.HYPER_DEBUG || process.env.HYPERTERM_DEBUG || isDev), + acceptFirstMouse: true, + webPreferences: { + nodeIntegration: true, + navigateOnDragDrop: true, + enableRemoteModule: true }, - options_ - ); - + ...options_ + }; const window = new BrowserWindow(app.plugins.getDecoratedBrowserOptions(winOpts)); window.uid = classOpts.uid;