In order to get jQuery to load and function correctly in a HTML page I was opening in Electron (formerly Atom Shell), I had to disable Node integration when creating the BrowserWindow
in my main.js
file.
Can someone please tell me what setting node-integration: false
will keep me from being able to do that I would normally be able to do had I not disabled it?
Electron node integration refers to the ability of accessing Node. js resources from within the “renderer” thread (the UI). It is enabled by default in Quasar CLI, although Electron is encouraging developers to turn it off as a security precaution.
Windows can be created from the renderer in two ways: clicking on links or submitting forms adorned with target=_blank. JavaScript calling window. open()
To safely get the mainWindow in electron, I store its ID in a env variable and call BrowserWindow. fromId(ID) when needed. BrowserWindow. getFocusedWindow() will not work in some case, for exemple if you load an URL from a child window to the main window.
Setting node-integration to false will disable node.js in the renderer process - i.e. your app can only do what a web browser will do. Instead of doing this, use Zepto.js which is compatible with Electron and has the same API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With