mirror of
https://github.com/LukeHagar/ui-development-kit.git
synced 2025-12-07 12:57:44 +00:00
Disabled note integration, enabled CSP
This commit is contained in:
@@ -5,6 +5,7 @@ import log from 'electron-log/main';
|
|||||||
import { start, load } from 'adapter-electron/functions';
|
import { start, load } from 'adapter-electron/functions';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import ess from 'electron-squirrel-startup';
|
import ess from 'electron-squirrel-startup';
|
||||||
|
import { session } from 'electron';
|
||||||
|
|
||||||
Object.assign(console, log.functions);
|
Object.assign(console, log.functions);
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ const createWindow = () => {
|
|||||||
minWidth: 800,
|
minWidth: 800,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
contextIsolation: true,
|
contextIsolation: true,
|
||||||
nodeIntegration: true,
|
nodeIntegration: false,
|
||||||
spellcheck: false,
|
spellcheck: false,
|
||||||
devTools: true,
|
devTools: true,
|
||||||
preload: path.join(__dirname, '../preload/index.mjs')
|
preload: path.join(__dirname, '../preload/index.mjs')
|
||||||
@@ -63,6 +64,15 @@ const createWindow = () => {
|
|||||||
mainWindow.on('close', () => {
|
mainWindow.on('close', () => {
|
||||||
windowState.saveState(mainWindow);
|
windowState.saveState(mainWindow);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||||
|
callback({
|
||||||
|
responseHeaders: {
|
||||||
|
...details.responseHeaders,
|
||||||
|
'Content-Security-Policy': ["script-src 'self' 'unsafe-inline' *"]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('Error creating window');
|
console.log('Error creating window');
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user