incr: enable context isolation

This commit is contained in:
18alantom
2023-07-10 14:42:20 +05:30
parent e2b9ea1f49
commit 92e8dfb6d7
7 changed files with 78 additions and 59 deletions
+2 -5
View File
@@ -4,6 +4,7 @@ require('source-map-support').install({
environment: 'node',
});
import { emitMainProcessError } from 'backend/helpers';
import {
app,
BrowserWindow,
@@ -12,7 +13,6 @@ import {
ProtocolRequest,
ProtocolResponse,
} from 'electron';
import Store from 'electron-store';
import { autoUpdater } from 'electron-updater';
import fs from 'fs';
import path from 'path';
@@ -21,7 +21,6 @@ import registerAutoUpdaterListeners from './main/registerAutoUpdaterListeners';
import registerIpcMainActionListeners from './main/registerIpcMainActionListeners';
import registerIpcMainMessageListeners from './main/registerIpcMainMessageListeners';
import registerProcessListeners from './main/registerProcessListeners';
import { emitMainProcessError } from 'backend/helpers';
export class Main {
title = 'Frappe Books';
@@ -54,8 +53,6 @@ export class Main {
'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0',
};
Store.initRenderer();
this.registerListeners();
if (this.isMac && this.isDevelopment) {
app.dock.setIcon(this.icon);
@@ -95,7 +92,7 @@ export class Main {
titleBarStyle: 'hidden',
trafficLightPosition: { x: 16, y: 16 },
webPreferences: {
contextIsolation: false, // TODO: Switch this off
contextIsolation: true,
nodeIntegration: true,
preload,
},