Skip to content

Commit 2b3ec02

Browse files
committed
fix(generator/background): disable contextIsolation when nodeIntegration is enabled
fixes #1279
1 parent a1dce10 commit 2b3ec02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

generator/templates/base/src/background.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ async function createWindow() {
2222
<% } %>
2323
// Use pluginOptions.nodeIntegration, leave this alone
2424
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
25-
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION
25+
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
26+
contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION
2627
}
2728
})
2829

0 commit comments

Comments
 (0)