diff --git a/main.ts b/main.ts index 257e36087..1500114da 100644 --- a/main.ts +++ b/main.ts @@ -12,6 +12,7 @@ const args = process.argv.slice(1), const api = new Api(); contextMenu(); +require('@electron/remote/main').initialize(); function createWindow(): BrowserWindow { // Create the browser window. @@ -23,7 +24,6 @@ function createWindow(): BrowserWindow { nodeIntegration: true, allowRunningInsecureContent: serve ? true : false, contextIsolation: false, - enableRemoteModule: true, webSecurity: false, }, resizable: true, @@ -36,6 +36,8 @@ function createWindow(): BrowserWindow { title: 'IPTVnator', }); + require('@electron/remote/main').enable(win.webContents); + if (serve) { win.webContents.openDevTools(); win.loadURL('http://localhost:4200'); @@ -73,7 +75,7 @@ function createEpgWorkerWindow() { show: false, webPreferences: { nodeIntegration: true, - enableRemoteModule: true, + contextIsolation: false, }, }); @@ -92,8 +94,6 @@ function createEpgWorkerWindow() { } try { - app.allowRendererProcessReuse = true; - // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs.