13

electron.js is a user interface toolkit that allows a web application to operate as an arbitrary GUI.

However, there are some applications that should be considered sensitive - for instance, a GUI for banking should have strong assurances that it's not doing anything mischievous.

I'm wondering if the electron executable (or node.js itself) would allow operation in a mode where networking is outright disabled - that way, as a consumer, I can at least be confident a user interface isn't sending my password off-site.

Something like ./node_modules/.bin/electron --no-networking index.js would be very convenient, albeit a far cry.

Athan Clark
  • 3,886
  • 2
  • 21
  • 39

1 Answers1

0

I haven't tried whether it works or not. The following lines simulate the offline mode in chromium.

// To emulate a network outage.

window.webContents.session.enableNetworkEmulation({ offline: true });
Sharvin K
  • 697
  • 3
  • 10
  • Not 100% sure but I think I have seen an open WebSocket connection exchange messages even when network emulation was enabled, so maybe it's not 100% fool-proof. – WofWca Apr 07 '23 at 13:11