Unable to disable WebSecurity along with NodeIntegration enabled #477

Closed
opened 2026-01-29 16:40:46 +00:00 by claunia · 1 comment
Owner

Originally created by @drozdzamadeusz on GitHub (Apr 23, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

  • Version: 7.30.2
  • Target: Windows

Setting NodeIntegration to true results in overwriting all other options in WebPreferences to its defaults. So it is impossible to use NodeIntegration = true along with WebSecurity = false, because WebSecurity value will be ignored.

Steps to Reproduce:
This can be reproduced using simple new generated electron app

        await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions
        {
            Show = true,
            WebPreferences = new WebPreferences
            {
                AllowRunningInsecureContent = true,
                WebSecurity = false,
                NodeIntegration = true,
            },
        });
Originally created by @drozdzamadeusz on GitHub (Apr 23, 2020). Originally assigned to: @GregorBiswanger on GitHub. <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 7.30.2 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> <!-- What target are you building for? --> * **Target**: Windows <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> Setting <code>NodeIntegration</code> to <code>true</code> results in overwriting all other options in <code>WebPreferences</code> to its defaults. So it is impossible to use `NodeIntegration = true` along with `WebSecurity = false`, because `WebSecurity` value will be ignored. Steps to Reproduce: This can be reproduced using simple new generated electron app await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { Show = true, WebPreferences = new WebPreferences { AllowRunningInsecureContent = true, WebSecurity = false, NodeIntegration = true, }, });
claunia added the bug label 2026-01-29 16:40:46 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Apr 24, 2020):

Fixed! Will be released with Electron.NET version 8.31.1.

@GregorBiswanger commented on GitHub (Apr 24, 2020): Fixed! Will be released with Electron.NET version 8.31.1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#477