Merge pull request #214 from Tanimodori/main

fix: allows electron security warnings, see #199
This commit is contained in:
草鞋没号 2022-07-25 20:20:55 +08:00 committed by GitHub
commit bfe73fea55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,10 @@ if (!app.requestSingleInstanceLock()) {
process.exit(0)
}
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
// Remove electron security warnings
// This warning only shows in development mode
// Read more on https://www.electronjs.org/docs/latest/tutorial/security
// process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
export const ROOT_PATH = {
// /dist
@ -35,6 +38,9 @@ async function createWindow() {
icon: join(ROOT_PATH.public, 'favicon.ico'),
webPreferences: {
preload,
// Warning: Enable nodeIntegration and disable contextIsolation is not secure in production
// Consider using contextBridge.exposeInMainWorld
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
nodeIntegration: true,
contextIsolation: false,
},