Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
In main.js I have set
nodeIntegration:false
for the BrowserWindow, but the app doesn't start, as I get this error in webview's console:
Uncaught ReferenceError: require is not defined
If I remove nodeIntegration:false
from main.js, it works, but I don't want to expose node API.
(P.S.: the remote web app pointed by the webview is using jQuery. Maybe a conflict?)
If you remove nodeIntegration : false
command like require
won't be set.
It seems like you have 2 possibilities :
let nodeIntegration: false
and deal with it
call your js file as if you were in browser : <script src="pathToFile"></script>
https://electronjs.org/docs/faq#i-can-not-use-jqueryrequirejsmeteorangularjs-in-electron here they explain what really does nodeIntegration
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.