feat: add support for --experimental-network-inspection (#47030)

* feat: add support for `--experimental-network-inspection`

Co-authored-by: Aman Karmani <aman@tmm1.net>

* docs: fix minor formatting issues

visible on both GH[1] and the docs site[2]

[1] https://github.com/electron/electron/blob/main/docs/api/command-line-switches.md#nodejs-flags
[2] https://www.electronjs.org/docs/latest/api/command-line-switches#--inspect-brkhostport

Co-authored-by: Aman Karmani <aman@tmm1.net>

* docs: add entry for new nodejs flag

Co-authored-by: Aman Karmani <aman@tmm1.net>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Aman Karmani <aman@tmm1.net>
This commit is contained in:
trop[bot] 2025-05-15 12:23:45 -07:00 committed by GitHub
commit 9c3331ea83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -256,7 +256,7 @@ Electron supports some of the [CLI flags][node-cli] supported by Node.js.
> [!NOTE]
> Passing unsupported command line switches to Electron when it is not running in `ELECTRON_RUN_AS_NODE` will have no effect.
### `--inspect-brk\[=\[host:]port]`
### `--inspect-brk[=[host:]port]`
Activate inspector on host:port and break at start of user script. Default host:port is 127.0.0.1:9229.
@ -268,13 +268,13 @@ Activate inspector on `host:port` and break at start of the first internal
JavaScript script executed when the inspector is available.
Default `host:port` is `127.0.0.1:9229`.
### `--inspect-port=\[host:]port`
### `--inspect-port=[host:]port`
Set the `host:port` to be used when the inspector is activated. Useful when activating the inspector by sending the SIGUSR1 signal. Default host is `127.0.0.1`.
Aliased to `--debug-port=[host:]port`.
### `--inspect\[=\[host:]port]`
### `--inspect[=[host:]port]`
Activate inspector on `host:port`. Default is `127.0.0.1:9229`.
@ -290,6 +290,10 @@ Specify ways of the inspector web socket url exposure.
By default inspector websocket url is available in stderr and under /json/list endpoint on `http://host:port/json/list`.
### `--experimental-network-inspector`
Enable support for devtools network inspector events, for visibility into requests made by the nodejs `http` and `https` modules.
### `--no-deprecation`
Silence deprecation warnings.

View file

@ -348,6 +348,7 @@ bool IsAllowedOption(const std::string_view option) {
"--inspect-brk-node",
"--inspect-port",
"--inspect-publish-uid",
"--experimental-network-inspection",
});
// This should be aligned with what's possible to set via the process object.