mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Setting NodeIntegration to false prevents Electron window from opening #330
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @raloverafs on GitHub (May 23, 2019).
Originally assigned to: @GregorBiswanger on GitHub.
Version: ElectronNET.CLI Version: 5.22.12.0
Target: .NET Core 2.1
Steps to Reproduce:
We need to set NodeIntegration to false because we are dependent on jQuery, Bootstrap, and Highcharts.
How can we fix this? Also, is there a workaround to make jQuery and Highcharts work in Electron.NET?
@GregorBiswanger commented on GitHub (May 23, 2019):
I don´t know, how do you reference the JavaScript files. Node integration refers to the windows. Is actually needed for IPC communication, or if you want JavaScript Libaries with the
requirecommand. I would not disable it.@rakista112 commented on GitHub (May 27, 2019):
I include them via script tags in Index.cshtml
<script src="/scripts/jquery-3.4.1.m.js"></script> <script src="/scripts/highcharts.js"></script> <script src="/scripts/es5-shim.min.js"></script> <script src="/scripts/es6-shim.min.js"></script> <script src="/scripts/ourproduct.min.js"></script>Then we get an error here
Why can't it find jQuery? We also get a similar error for highcharts.
@GregorBiswanger commented on GitHub (May 29, 2019):
Please open the Chrome Dev Tools and analyse the script loading errors:
Electron.WindowManager.BrowserWindows.First().WebContents.OpenDevTools()I think that is only a path problem.
Alternative try to set a base href in the index.html:
@gfs commented on GitHub (Jun 1, 2019):
@rakista112 I noticed a similar issue getting jQuery to load. As dumb as it sounds, including it twice in the html fixed it.
@rakista112 commented on GitHub (Jun 3, 2019):
Hi I was able to import and use jQuery and Highcharts using the info in the Electron wiki.
I followed the instructions here. https://electronjs.org/docs/faq#i-can-not-use-jqueryrequirejsmeteorangularjs-in-electron
I actually tried the wiki solution a couple of times before posting this thread. I only thought the solution wasn't working because the previous client build/javascript was getting stuck.
I had to delete the
obj/directory in the project directory.It's really cumbersome but I have to do it every time I make a new build because I'm afraid I might be running outdated code.
@GregorBiswanger commented on GitHub (May 9, 2020):
Can be deactivated. However, IPC can then no longer be used.