From 376634c75a5cae443c664f7369480a589427aa81 Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Fri, 9 May 2025 06:44:14 -0700 Subject: [PATCH] feat: add support for `--experimental-network-inspection` (#46690) * feat: add support for `--experimental-network-inspection` * 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 * docs: add entry for new nodejs flag --- docs/api/command-line-switches.md | 10 +++++++--- shell/common/node_bindings.cc | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/api/command-line-switches.md b/docs/api/command-line-switches.md index a07a3eb952..098d49d539 100644 --- a/docs/api/command-line-switches.md +++ b/docs/api/command-line-switches.md @@ -254,7 +254,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. @@ -266,13 +266,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`. @@ -288,6 +288,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. diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 28597c3f66..1f74616e83 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -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.