-
-
Notifications
You must be signed in to change notification settings - Fork 280
Is nodeIntegration required? #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same question |
Noticed the same when I tried to turn it off |
Didn't realize this many people wanted this, thanks for letting me know. I think the issue is because I set the webpack target to |
Also, you will have to do this for spectron testing. |
@nklayman I don't really understand What is the difference between a |
@cawa-93 https://webpack.js.org/configuration/target/ The explanation isn't that clear though 😕 @nklayman I don't think setting it to default will fix it. The different entry points need different targets.
There is also the preload script that can contain |
Maybe introduce some configuration like this: // vue.config.js
module.exports = {
pluginOptions: {
electronBuilder: {
entryPoints: {
main: {path: ... , target: ...},
preload: {path: ... , target: ...},
renderer: {path: ... , target: ...},
},
builderOptions: {
// options placed here will be merged with default configuration and passed to electron-builder
}
}
}
} |
|
that sounds great. is preload added by default? |
@Sparkenstein I created #742 to collect some security recommendations that can be implemented in v2.0 and described in a new documentation section. Can you please repost your comment there for better tracking? Thanks! |
I am aware it is quite a while back since you asked this question, however, for any still remaining with questions, more can be found at the documentation page of Electron. Here you can find the explanation of what is meant by preloading. Here you can find the explanation of what is meant by renderer. As for main, it would be quite self explanatory as this is where your main Electron related logic should live. This would be your |
Hey,
I have been reading up on Electron best practices and the official docs recommend turning off
nodeIntegration
for any renderer that loads remote content.In my app, I use a preload script to expose any node modules that I need in the renderer process. Everything else is handled via
IPC
.nodeIntegration
is not required in my app. Turning it off , however, breaks the app. It just doesn't launch.Error message
Root cause
I tried using a new project, disabled
nodeIntegration
and the error still appeared. There are few issues on Github about this and the solution is alwaysIs this a bug or expected behavior?
The text was updated successfully, but these errors were encountered: