electron: [Bug]: nodeIntegration=true flag in webPreferences causes screen to blank out

Preflight Checklist

Electron Version

26.0.0

What operating system are you using?

Ubuntu

Operating System Version

Ubuntu 23.04

What arch are you using?

x64

Last Known Working Electron version

25.5.0

Expected Behavior

Expect app to load normally and remain visible.

Actual Behavior

When using the nodeIntegration: true in webPreferences the renderer goes blank within 1-2 seconds of app loading. It had been working fine in previous releases.

If I set nodeIntegration: false the app disappearing stops happening.

Testcase Gist URL

No response

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 14
  • Comments: 31 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I can confirm this bug.

Only happens with electron@26-x-y. With electron@25-x-y and electron@alpha (which right now is 27.0.0-alpha.5) everything works fine. I could only test this on a Linux system.

For test purposes, I created a minimal Electron app: https://github.com/WortgeschichteDigital/MinimalElectronApp. “Hello world!” should disappear after about two seconds. Removing nodeIntegration: true on line 21 of main.js does the trick. After that the app won’t crash anymore.

Crash dump: Crashpad.zip

BTW, the DevTool window prints the message “DevTools was disconnected from the page” (see image). You have to be fast enough to open them before the app crashes, though. Hope that helps!

DevTools

+1

Can confirm I also have this exact same issue. Here are my machine specs:

Ubuntu 22.04.2 LTS
11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz × 8
Mesa Intel® Xe Graphics (TGL GT2)

Electron 26.1.0

Confirmed still broken on latest Arch Linux with GNOME + Wayland on 26.2.1. Last working stable version is 25.8.0.

I can also confirm this bug. It is happening in only some Linux systems. Windows & macOS seem to be fine.

That would mean that upgrading from Chromium 116 to 117 fixed the issue, given that there are only 3 commits between those 2 nightly versions of v27, two of which are most likely unrelated, see https://github.com/electron/electron/compare/v27.0.0-nightly.20230630...v27.0.0-nightly.20230703 And that that v26 nightly is the last Electron release to feature 115, as the next v26 nightly jumps to Chromium 116, see: https://github.com/electron/electron/compare/v26.0.0-nightly.20230525...v26.0.0-nightly.20230529 In other words, all the affected Electron versions use Chromium 116.

I’m not sure if it’s really useful: electron-nightly@27.0.0-nightly.20230630 is the last affected build electron-nightly@27.0.0-nightly.20230703 and newer work ok. and from other side: electron-nightly@26.0.0-nightly.20230525 was last working build