feat: Enhance Electron test harness with preload script and CSP configuration
This commit is contained in:
@@ -3,8 +3,7 @@ const path = require('path');
|
||||
|
||||
/**
|
||||
* Creates the main application window.
|
||||
* nodeIntegration is enabled so the renderer can use require() / dynamic import()
|
||||
* directly against the local node_modules — appropriate for a local test harness.
|
||||
* Uses a preload bridge so the renderer can stay in the safer default context.
|
||||
*/
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
@@ -12,8 +11,10 @@ function createWindow() {
|
||||
height: 800,
|
||||
backgroundColor: '#1a1a2e',
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
preload: path.join(__dirname, 'preload.js'),
|
||||
sandbox: false,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user