Skip to content

Commit 91d2aee

Browse files
committed
fix: disable secur on dev
1 parent ae529fd commit 91d2aee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/windowsManager.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ let instance;
3232
* @param {import('electron').BrowserViewConstructorOptions} option
3333
*/
3434
function createWindow(name, option) {
35-
const ref = new BrowserWindow(option);
35+
const ops = { ...option };
36+
if (!ops.webPreferences) { ops.webPreferences = {}; }
37+
ops.webPreferences.webSecurity = !isDev; // disable security for loading local image
38+
const ref = new BrowserWindow(ops);
3639
ipcMain.emit('browser-window-setup', ref, name);
3740
ref.loadURL(`${baseURL}${name}`);
3841
console.log(`Create window from ${`${baseURL}${name}`}`);

0 commit comments

Comments
 (0)