Skip to content

inspector: initial support for Network.loadNetworkResource#58077

Merged
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
islandryu:feat/inspector-load-resource
Jul 10, 2025
Merged

inspector: initial support for Network.loadNetworkResource#58077
nodejs-github-bot merged 5 commits into
nodejs:mainfrom
islandryu:feat/inspector-load-resource

Conversation

@islandryu

@islandryu islandryu commented Apr 29, 2025

Copy link
Copy Markdown
Member

Fixes: #57873

Adds initial support for Network.loadNetworkResource in the inspector.
https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource

how to load network resource

Resource fetching is done via a spawned child process to keep the inspector's event loop clean and isolated.
The JavaScript code for the fetch process is currently hardcoded, which may not be ideal, but I couldn't come up with a better approach at this point.

When --experimental-inspector-network-resource is set, a dedicated worker for loadNetworkResource is launched.
This worker fetches the resource and returns the result to the frontend.
https://github.com/nodejs/node/pull/58077/files#diff-5d3d58cbcfda008f49966a11d73863e67b78a237aa386f1fbdc5c9124136c1eb

check the behavior in chromium

To verify this change in Chromium, modify the section in the link as shown below and launch Chromium with the built DevTools frontend.

https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/core/sdk/Target.ts;l=87-88

      case Type.NODE:
        this.#capabilitiesMask = Capability.JS | Capability.NETWORK | Capability.TARGET | Capability.IO;
# open Chromium with built devtools-frontend
Chromium --custom-devtools-frontend=(file path)

other infomation

If this change is considered acceptable, I will send a follow-up change request to expand the Node.js DevTools target with IO support.
If it is necessary to wait until Network.loadNetworkResource becomes stable in CRDP, please feel free to keep this PR pending.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/gyp

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 29, 2025
@islandryu islandryu force-pushed the feat/inspector-load-resource branch from 86ba453 to 435c33f Compare April 29, 2025 13:02
@islandryu islandryu changed the title feat(inspector): initial support for Network.loadNetworkResource inspector: initial support for Network.loadNetworkResource Apr 29, 2025
@codecov

codecov Bot commented Apr 29, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 91.92547% with 13 lines in your changes missing coverage. Please review.

Project coverage is 90.06%. Comparing base (0992d28) to head (04d8eca).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/inspector/network_resources.js 77.77% 6 Missing ⚠️
src/inspector/network_agent.cc 85.18% 2 Missing and 2 partials ⚠️
src/inspector_js_api.cc 72.72% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58077      +/-   ##
==========================================
- Coverage   90.06%   90.06%   -0.01%     
==========================================
  Files         641      645       +4     
  Lines      188846   188996     +150     
  Branches    37049    37063      +14     
==========================================
+ Hits       170087   170211     +124     
- Misses      11476    11488      +12     
- Partials     7283     7297      +14     
Files with missing lines Coverage Δ
lib/inspector.js 97.04% <100.00%> (+0.10%) ⬆️
src/inspector/io_agent.cc 100.00% <100.00%> (ø)
src/inspector/io_agent.h 100.00% <100.00%> (ø)
src/inspector/network_agent.h 100.00% <ø> (ø)
src/inspector/network_inspector.cc 90.90% <100.00%> (+0.90%) ⬆️
src/inspector/network_inspector.h 100.00% <ø> (ø)
src/inspector/network_resource_manager.cc 100.00% <100.00%> (ø)
src/inspector/worker_inspector.cc 95.89% <100.00%> (+0.05%) ⬆️
src/inspector/worker_inspector.h 100.00% <100.00%> (ø)
src/inspector_agent.cc 79.91% <100.00%> (+0.33%) ⬆️
... and 6 more

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/inspector/io_agent.cc Outdated
Comment thread src/inspector/network_agent.cc Outdated
Comment thread src/inspector/network_agent.cc Outdated
@islandryu islandryu force-pushed the feat/inspector-load-resource branch 2 times, most recently from 5e20033 to 1f0c547 Compare May 27, 2025 12:43
@islandryu

Copy link
Copy Markdown
Member Author

@legendecas cc: @joyeecheung
I made changes to spawn a worker process for fetching.
It’s also possible to change it so that this behavior is delegated to the user via the Inspector JS API.
However, since the worker needs to be launched before the entry file is loaded in order to resolve source maps for Chrome DevTools, this part likely cannot be delegated to the user.

Comment thread lib/internal/inspector/load_network_resource_worker.js Outdated
@islandryu islandryu force-pushed the feat/inspector-load-resource branch 2 times, most recently from 8b582eb to ce745ca Compare June 22, 2025 13:15
@islandryu

Copy link
Copy Markdown
Member Author

The implementation approach was significantly changed in commit ce745ca.
I talked with @legendecas, and we decided to adopt an implementation that only returns resources that were preemptively put, as it requires less consideration in terms of security and implementation complexity.

@islandryu islandryu requested a review from legendecas June 22, 2025 14:49

@legendecas legendecas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work! The new approach looks more straightforward as a first step to me.

Comment thread src/inspector/network_resource_manager.h Outdated
Comment thread test/parallel/test-inspector-network-resource.js
@islandryu islandryu force-pushed the feat/inspector-load-resource branch 2 times, most recently from 0e70772 to 688e313 Compare June 29, 2025 15:41
Comment thread test/parallel/test-inspector-network-resource.js

@legendecas legendecas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Some minor suggestions..

Comment thread src/inspector/network_agent.cc
Comment thread src/inspector/network_resource_manager.h
Comment thread test/parallel/test-inspector-network-resource.js Outdated
Comment thread test/parallel/test-inspector-network-resource.js Outdated
@legendecas legendecas added request-ci Add this label to start a Jenkins CI on a PR. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Jul 3, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@islandryu islandryu force-pushed the feat/inspector-load-resource branch from 2a37101 to 160eedb Compare July 3, 2025 12:58
@islandryu islandryu force-pushed the feat/inspector-load-resource branch from 2688004 to 04d8eca Compare July 9, 2025 05:38
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@islandryu islandryu requested a review from legendecas July 10, 2025 09:47
@legendecas legendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 10, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 10, 2025
@nodejs-github-bot nodejs-github-bot merged commit b7db89f into nodejs:main Jul 10, 2025
56 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in b7db89f

@joyeecheung

Copy link
Copy Markdown
Member

test-inspector-network-fetch has been flaky in the CI: https://github.com/nodejs/reliability/blob/main/reports/2025-07-11.md - it also have failed once in this PR it seems

@islandryu

Copy link
Copy Markdown
Member Author

I'll check it as soon as the Jenkins security embargo is lifted.

targos pushed a commit that referenced this pull request Jul 17, 2025
Fixes: #57873
PR-URL: #58077
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 4, 2025
Fixes: #57873
PR-URL: #58077
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 4, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [node](https://nodejs.org) ([source](https://github.com/nodejs/node)) | minor | `24.4.1` -> `24.5.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>nodejs/node (node)</summary>

### [`v24.5.0`](https://github.com/nodejs/node/releases/tag/v24.5.0): 2025-07-31, Version 24.5.0 (Current), @&#8203;aduh95

[Compare Source](nodejs/node@v24.4.1...v24.5.0)

##### Notable Changes

##### Upgrade to OpenSSL 3.5

This release is distributed with OpenSSL 3.5.1, following the announcement that
OpenSSL 3.5 will be supported until April 2030, while Node.js 24 will be
supported until April 2028. Read more about OpenSSL support in their blog post:
<https://openssl-library.org/post/2025-02-20-openssl-3.5-lts/>.

Contributed by Richard Lau in [#&#8203;58100](nodejs/node#58100).

##### Unflag `--experimental-wasm-modules`

Node.js supports both source phase imports and instance phase imports to WebAssembly
modules and for WASM imports to JavaScript, in line with the current Phase 3
WebAssembly [ESM Integration](https://github.com/webassembly/esm-integration) proposal.
The implementation and the specification are still subject to change.

Contributed by Guy Bedford in [#&#8203;57038](nodejs/node#57038).

##### Built-in proxy support in `request()` and `Agent`

`node:http` and `node:https` now support proxies. When `NODE_USE_ENV_PROXY`
is set to `1`, the default global agent would parse the `http_proxy`/`HTTP_PROXY`,
`https_proxy`/`HTTPS_PROXY`, `no_proxy`/`NO_PROXY` settings from the
environment variables, and proxy the requests sent through the built-in http/https
client accordingly.

To use global proxy support from the command line:

```bash
NODE_USE_ENV_PROXY=1 HTTP_PROXY=http://proxy.example.com:8080 HTTPS_PROXY=http://proxy.example.com:8080 NO_PROXY=localhost,127.0.0.1 node client.js
```

In addition, `http.Agent` and `https.Agent` now support the custom `proxyEnv` options.

```js
const agent = new https.Agent({ proxyEnv: { HTTPS_PROXY: 'http://proxy.example.com:8080' } });
```

For reference, `fetch()` already supports `NODE_USE_ENV_PROXY` as of Node.js 24.0.0.

Contributed by Joyee Cheung in [#&#8203;58980](nodejs/node#58980).

##### Add `setDefaultCACertificates()` to `node:tls`

This API allows dynamically configuring CA certificates that will be used by the
Node.js TLS clients by default.

Once called, the provided certificates will become the default CA certificate list
returned by `tls.getCACertificates('default')` and used by TLS connections that
don't specify their own CA certificates.

To add system CA certificates to the default bundle (which includes the Mozilla
CA certificates):

```js
tls.setDefaultCACertificates(tls.getCACertificates('default').concat(tls.getCACertificates('system')));
```

Contributed by Joyee Cheung in [#&#8203;58822](nodejs/node#58822).

##### Other notable changes

- \[[`d5640ca58a`](nodejs/node@d5640ca58a)] - **(SEMVER-MINOR)** **cli**: support `${pid}` placeholder in `--cpu-prof-name` (Haram Jeong) [#&#8203;59072](nodejs/node#59072)
- \[[`c52aaacfc5`](nodejs/node@c52aaacfc5)] - **(SEMVER-MINOR)** **dns**: support max timeout (theanarkh) [#&#8203;58440](nodejs/node#58440)
- \[[`927742b342`](nodejs/node@927742b342)] - **doc**: update the instruction on how to verify releases (Antoine du Hamel) [#&#8203;59113](nodejs/node#59113)
- \[[`f753645cd8`](nodejs/node@f753645cd8)] - **(SEMVER-MINOR)** **net**: update net.blocklist to allow file save and file management (alphaleadership) [#&#8203;58087](nodejs/node#58087)
- \[[`9791ff3480`](nodejs/node@9791ff3480)] - **(SEMVER-MINOR)** **worker**: add web locks api (ishabi) [#&#8203;58666](nodejs/node#58666)

##### Commits

- \[[`5457c7a8a1`](nodejs/node@5457c7a8a1)] - **benchmark**: adjust configuration for string-decoder bench (Rafael Gonzaga) [#&#8203;59187](nodejs/node#59187)
- \[[`28538f2255`](nodejs/node@28538f2255)] - **benchmark**: add --track to benchmark (Rafael Gonzaga) [#&#8203;59174](nodejs/node#59174)
- \[[`a28d804497`](nodejs/node@a28d804497)] - **benchmark**: small lint fix on \_cli.js (Rafael Gonzaga) [#&#8203;59172](nodejs/node#59172)
- \[[`09717eb68e`](nodejs/node@09717eb68e)] - **benchmark**: drop misc/punycode benchmark (Rafael Gonzaga) [#&#8203;59171](nodejs/node#59171)
- \[[`ad6757ef02`](nodejs/node@ad6757ef02)] - **benchmark**: fix sqlite-is-transaction (Rafael Gonzaga) [#&#8203;59170](nodejs/node#59170)
- \[[`7fc3143f61`](nodejs/node@7fc3143f61)] - **benchmark**: reduce N for diagnostics\_channel subscribe benchmark (Arthur Angelo) [#&#8203;59116](nodejs/node#59116)
- \[[`f2812723a0`](nodejs/node@f2812723a0)] - **buffer**: cache Environment::GetCurrent to avoid repeated calls (Mert Can Altin) [#&#8203;59043](nodejs/node#59043)
- \[[`e3e729ca60`](nodejs/node@e3e729ca60)] - **build**: remove suppressions.supp (Rafael Gonzaga) [#&#8203;59079](nodejs/node#59079)
- \[[`dc66422768`](nodejs/node@dc66422768)] - **build,deps,tools**: prepare to update to OpenSSL 3.5 (Richard Lau) [#&#8203;58100](nodejs/node#58100)
- \[[`f5da4947d9`](nodejs/node@f5da4947d9)] - **cli**: add --use-env-proxy (Joyee Cheung) [#&#8203;59151](nodejs/node#59151)
- \[[`d5640ca58a`](nodejs/node@d5640ca58a)] - **(SEMVER-MINOR)** **cli**: support `${pid}` placeholder in --cpu-prof-name (Haram Jeong) [#&#8203;59072](nodejs/node#59072)
- \[[`eeeb40e95b`](nodejs/node@eeeb40e95b)] - **(SEMVER-MINOR)** **crypto**: add tls.setDefaultCACertificates() (Joyee Cheung) [#&#8203;58822](nodejs/node#58822)
- \[[`135fca5b72`](nodejs/node@135fca5b72)] - **crypto**: avoid copying buffers to UTF-8 strings in `crypto.hash()` (Renegade334) [#&#8203;59067](nodejs/node#59067)
- \[[`998cef10e3`](nodejs/node@998cef10e3)] - **deps**: update archs files for openssl-3.5.1 (Node.js GitHub Bot) [#&#8203;59234](nodejs/node#59234)
- \[[`1f06ca956a`](nodejs/node@1f06ca956a)] - **deps**: upgrade openssl sources to openssl-3.5.1 (Node.js GitHub Bot) [#&#8203;59234](nodejs/node#59234)
- \[[`55a90eed8d`](nodejs/node@55a90eed8d)] - **deps**: upgrade npm to 11.5.1 (npm team) [#&#8203;59199](nodejs/node#59199)
- \[[`2b5d451ae0`](nodejs/node@2b5d451ae0)] - **deps**: update amaro to 1.1.1 (Node.js GitHub Bot) [#&#8203;59141](nodejs/node#59141)
- \[[`af789d9b5c`](nodejs/node@af789d9b5c)] - **deps**: update undici to 7.12.0 (Node.js GitHub Bot) [#&#8203;59135](nodejs/node#59135)
- \[[`a34e44545e`](nodejs/node@a34e44545e)] - **deps**: update sqlite to 3.50.3 (Node.js GitHub Bot) [#&#8203;59132](nodejs/node#59132)
- \[[`bfe4781c7d`](nodejs/node@bfe4781c7d)] - **deps**: update googletest to [`7e17b15`](nodejs/node@7e17b15) (Node.js GitHub Bot) [#&#8203;59131](nodejs/node#59131)
- \[[`72adf52e51`](nodejs/node@72adf52e51)] - **deps**: update ada to 3.2.6 (Node.js GitHub Bot) [#&#8203;58966](nodejs/node#58966)
- \[[`2a5f35b589`](nodejs/node@2a5f35b589)] - **deps**: V8: cherry-pick [`3d750c2`](nodejs/node@3d750c2aa9ef) (Michaël Zasso) [#&#8203;58750](nodejs/node#58750)
- \[[`3f813eaba7`](nodejs/node@3f813eaba7)] - **deps**: update archs files for openssl-3.0.17 (Node.js GitHub Bot) [#&#8203;59134](nodejs/node#59134)
- \[[`fb52d0d8df`](nodejs/node@fb52d0d8df)] - **deps**: upgrade openssl sources to openssl-3.0.17 (Node.js GitHub Bot) [#&#8203;59134](nodejs/node#59134)
- \[[`f122602f9d`](nodejs/node@f122602f9d)] - **deps**: update corepack to 0.34.0 (Node.js GitHub Bot) [#&#8203;59133](nodejs/node#59133)
- \[[`c52aaacfc5`](nodejs/node@c52aaacfc5)] - **(SEMVER-MINOR)** **dns**: support max timeout (theanarkh) [#&#8203;58440](nodejs/node#58440)
- \[[`927742b342`](nodejs/node@927742b342)] - **doc**: update the instruction on how to verify releases (Antoine du Hamel) [#&#8203;59113](nodejs/node#59113)
- \[[`9a8d2020ad`](nodejs/node@9a8d2020ad)] - **doc**: copyedit SECURITY.md (Rich Trott) [#&#8203;59190](nodejs/node#59190)
- \[[`3da5bc0668`](nodejs/node@3da5bc0668)] - **doc**: fix broken sentence in `URL.parse` (Superchupu) [#&#8203;59164](nodejs/node#59164)
- \[[`06cd7461e0`](nodejs/node@06cd7461e0)] - **doc**: improve onboarding instructions (Joyee Cheung) [#&#8203;59159](nodejs/node#59159)
- \[[`dfb72d158b`](nodejs/node@dfb72d158b)] - **doc**: add constraints for mem leak to threat model (Rafael Gonzaga) [#&#8203;58917](nodejs/node#58917)
- \[[`51b8dfd5c6`](nodejs/node@51b8dfd5c6)] - **doc**: add Aditi-1400 to collaborators (Aditi) [#&#8203;59157](nodejs/node#59157)
- \[[`4ffa756ce3`](nodejs/node@4ffa756ce3)] - **doc**: avoid suggesting testing fast api with intense loop (Chengzhong Wu) [#&#8203;59111](nodejs/node#59111)
- \[[`6f81b274f7`](nodejs/node@6f81b274f7)] - **doc**: fix typo in writing-test.md (SeokHun) [#&#8203;59123](nodejs/node#59123)
- \[[`88e434e687`](nodejs/node@88e434e687)] - **doc**: add new environment variables doc page (Dario Piotrowicz) [#&#8203;59052](nodejs/node#59052)
- \[[`b1a318d706`](nodejs/node@b1a318d706)] - **doc**: update release key for aduh95 (Antoine du Hamel) [#&#8203;58877](nodejs/node#58877)
- \[[`34c49000c9`](nodejs/node@34c49000c9)] - **doc**: add missing section for `setReturnArrays` in `sqlite.md` (Edy Silva) [#&#8203;59074](nodejs/node#59074)
- \[[`9b2e965aff`](nodejs/node@9b2e965aff)] - **doc**: add RafaelGSS as steward July 25 (Rafael Gonzaga) [#&#8203;59078](nodejs/node#59078)
- \[[`2d1dcb87e6`](nodejs/node@2d1dcb87e6)] - **doc**: clarify ERR\_FS\_FILE\_TOO\_LARGE to reflect fs.readFile() I/O limit (Haram Jeong) [#&#8203;59050](nodejs/node#59050)
- \[[`999b5e51e7`](nodejs/node@999b5e51e7)] - **doc**: run license-builder (github-actions\[bot]) [#&#8203;59056](nodejs/node#59056)
- \[[`1940a2cb46`](nodejs/node@1940a2cb46)] - **doc**: fix typed list formatting (Aviv Keller) [#&#8203;59019](nodejs/node#59019)
- \[[`6cb5e0d22f`](nodejs/node@6cb5e0d22f)] - **doc**: refine `util.parseArgs` `default` definition (Slayer95) [#&#8203;58958](nodejs/node#58958)
- \[[`d2e7f8e13a`](nodejs/node@d2e7f8e13a)] - **doc**: remove unused import in `zlib.md` (coderaiser) [#&#8203;59041](nodejs/node#59041)
- \[[`9d02960149`](nodejs/node@9d02960149)] - **doc**: add missing environment variables to manpage (amir lavasani) [#&#8203;58963](nodejs/node#58963)
- \[[`45ffdb34fb`](nodejs/node@45ffdb34fb)] - **doc**: add stability index to the `--watch-kill-signal` flag (Dario Piotrowicz) [#&#8203;58997](nodejs/node#58997)
- \[[`3924c43600`](nodejs/node@3924c43600)] - **doc**: add missing `<code>` blocks (Antoine du Hamel) [#&#8203;58995](nodejs/node#58995)
- \[[`cb95e183f3`](nodejs/node@cb95e183f3)] - **doc**: add scroll margin to links (Roman Reiss) [#&#8203;58982](nodejs/node#58982)
- \[[`c9ded6ba15`](nodejs/node@c9ded6ba15)] - **doc**: add sponsorship link to RafaelGSS (Rafael Gonzaga) [#&#8203;58983](nodejs/node#58983)
- \[[`b919fe0447`](nodejs/node@b919fe0447)] - **(SEMVER-MINOR)** **esm**: unflag --experimental-wasm-modules (Guy Bedford) [#&#8203;57038](nodejs/node#57038)
- \[[`71bb6cd077`](nodejs/node@71bb6cd077)] - **esm**: js-string Wasm builtins in ESM Integration (Guy Bedford) [#&#8203;59020](nodejs/node#59020)
- \[[`8d869e6d62`](nodejs/node@8d869e6d62)] - **fs**: fix return value of fs APIs (theanarkh) [#&#8203;58996](nodejs/node#58996)
- \[[`7f654cee9e`](nodejs/node@7f654cee9e)] - **(SEMVER-MINOR)** **http,https**: add built-in proxy support in http/https.request and Agent (Joyee Cheung) [#&#8203;58980](nodejs/node#58980)
- \[[`85d6a28f4f`](nodejs/node@85d6a28f4f)] - **inspector**: initial support for Network.loadNetworkResource (Shima Ryuhei) [#&#8203;58077](nodejs/node#58077)
- \[[`cfaa299f2e`](nodejs/node@cfaa299f2e)] - **lib**: fix incorrect `ArrayBufferPrototypeGetDetached` primordial type (Dario Piotrowicz) [#&#8203;58978](nodejs/node#58978)
- \[[`d555db22ad`](nodejs/node@d555db22ad)] - **lib**: flag to conditionally modify proto on deprecate (Rafael Gonzaga) [#&#8203;58928](nodejs/node#58928)
- \[[`96c9dd79e6`](nodejs/node@96c9dd79e6)] - **meta**: move one or more collaborators to emeritus (Node.js GitHub Bot) [#&#8203;59140](nodejs/node#59140)
- \[[`324d9fc9d4`](nodejs/node@324d9fc9d4)] - **meta**: enable jsdoc/check-tag-names rule (Yagiz Nizipli) [#&#8203;58521](nodejs/node#58521)
- \[[`04c751463b`](nodejs/node@04c751463b)] - **meta**: add marco-ippolito to security release stewards (Marco Ippolito) [#&#8203;58944](nodejs/node#58944)
- \[[`fe0195fdcc`](nodejs/node@fe0195fdcc)] - **module**: fix conditions override in synchronous resolve hooks (Joyee Cheung) [#&#8203;59011](nodejs/node#59011)
- \[[`515b581d47`](nodejs/node@515b581d47)] - **module**: throw error when re-runing errored module jobs (Joyee Cheung) [#&#8203;58957](nodejs/node#58957)
- \[[`f753645cd8`](nodejs/node@f753645cd8)] - **(SEMVER-MINOR)** **net**: update net.blocklist to allow file save and file management (alphaleadership) [#&#8203;58087](nodejs/node#58087)
- \[[`15e6c28d82`](nodejs/node@15e6c28d82)] - **node-api,doc**: update links to ecma262 with section names (Chengzhong Wu) [#&#8203;59087](nodejs/node#59087)
- \[[`f67b686551`](nodejs/node@f67b686551)] - **perf\_hooks**: do not expose SafeMap via Histogram wrapper (René) [#&#8203;59094](nodejs/node#59094)
- \[[`3d2f919f7c`](nodejs/node@3d2f919f7c)] - **process**: make execve's args argument optional (Allon Murienik) [#&#8203;58412](nodejs/node#58412)
- \[[`1a44265810`](nodejs/node@1a44265810)] - **repl**: handle errors from getters during completion (Shima Ryuhei) [#&#8203;59044](nodejs/node#59044)
- \[[`467dbd31e6`](nodejs/node@467dbd31e6)] - **repl**: fix repl crashing on variable declarations without init (Dario Piotrowicz) [#&#8203;59032](nodejs/node#59032)
- \[[`3a3eb6852d`](nodejs/node@3a3eb6852d)] - **repl**: improve REPL disabling completion on proxies and getters (Dario Piotrowicz) [#&#8203;58891](nodejs/node#58891)
- \[[`55838e79b8`](nodejs/node@55838e79b8)] - **src**: call unmask after install signal handler (theanarkh) [#&#8203;59059](nodejs/node#59059)
- \[[`77649ad93b`](nodejs/node@77649ad93b)] - **src**: use `FastStringKey` for `TrackV8FastApiCall` (Anna Henningsen) [#&#8203;59148](nodejs/node#59148)
- \[[`86babf9c4b`](nodejs/node@86babf9c4b)] - **src**: use C++20 `consteval` for `FastStringKey` (Anna Henningsen) [#&#8203;59148](nodejs/node#59148)
- \[[`88b99eeae1`](nodejs/node@88b99eeae1)] - **src**: remove declarations of removed BaseObject static fns (Anna Henningsen) [#&#8203;59093](nodejs/node#59093)
- \[[`d89390fc8f`](nodejs/node@d89390fc8f)] - **src**: add cache to nearest parent package json (Ilyas Shabi) [#&#8203;59086](nodejs/node#59086)
- \[[`21780075e4`](nodejs/node@21780075e4)] - **src**: check import attributes value types as strings (Chengzhong Wu) [#&#8203;58986](nodejs/node#58986)
- \[[`ef89c2fac9`](nodejs/node@ef89c2fac9)] - **src,test**: fix config file parsing for flags defaulted to true (Edy Silva) [#&#8203;59110](nodejs/node#59110)
- \[[`1e990866e0`](nodejs/node@1e990866e0)] - **test**: mark web lock held test as flaky (Ilyas Shabi) [#&#8203;59144](nodejs/node#59144)
- \[[`ba8e95a785`](nodejs/node@ba8e95a785)] - **test**: use mustSucceed in test-fs-read (Sungwon) [#&#8203;59204](nodejs/node#59204)
- \[[`39978f507f`](nodejs/node@39978f507f)] - **test**: prepare test-crypto-rsa-dsa for newer OpenSSL (Richard Lau) [#&#8203;58100](nodejs/node#58100)
- \[[`1c3aadb9d6`](nodejs/node@1c3aadb9d6)] - **test**: fix flaky test-worker-message-port-transfer-filehandle test (Alex Yang) [#&#8203;59158](nodejs/node#59158)
- \[[`a0d22e9c51`](nodejs/node@a0d22e9c51)] - **test**: remove timeout in test-https-proxy-request-handshake-failure (Joyee Cheung) [#&#8203;59165](nodejs/node#59165)
- \[[`7e0a0fccc1`](nodejs/node@7e0a0fccc1)] - **test**: expand linting rules around `assert` w literal messages (Anna Henningsen) [#&#8203;59147](nodejs/node#59147)
- \[[`c6070046c3`](nodejs/node@c6070046c3)] - **test**: update WPT for WebCryptoAPI to [`ab08796`](nodejs/node@ab08796857) (Node.js GitHub Bot) [#&#8203;59129](nodejs/node#59129)
- \[[`15d8cc908e`](nodejs/node@15d8cc908e)] - **test**: update WPT for WebCryptoAPI to [`19d82c5`](nodejs/node@19d82c57ab) (Node.js GitHub Bot) [#&#8203;59129](nodejs/node#59129)
- \[[`83023e5144`](nodejs/node@83023e5144)] - **test**: skip tests that cause timeouts on IBM i (Abdirahim Musse) [#&#8203;59014](nodejs/node#59014)
- \[[`82d4175ec3`](nodejs/node@82d4175ec3)] - **test**: update `startCLI` to set `--port=0` by default (Dario Piotrowicz) [#&#8203;59042](nodejs/node#59042)
- \[[`16dc53c143`](nodejs/node@16dc53c143)] - **(SEMVER-MINOR)** **test**: move http proxy tests to test/client-proxy (Joyee Cheung) [#&#8203;58980](nodejs/node#58980)
- \[[`a9511a6066`](nodejs/node@a9511a6066)] - **test**: mark test-inspector-network-fetch as flaky on Windows (Joyee Cheung) [#&#8203;59091](nodejs/node#59091)
- \[[`1cffcc02a3`](nodejs/node@1cffcc02a3)] - **test**: add missing port=0 arg in test-debugger-extract-function-name (Dario Piotrowicz) [#&#8203;58977](nodejs/node#58977)
- \[[`83cdf1701b`](nodejs/node@83cdf1701b)] - **test\_runner**: clean up promisified interval generation (René) [#&#8203;58824](nodejs/node#58824)
- \[[`195d6038dc`](nodejs/node@195d6038dc)] - **tools**: clarify README linter error message (Joyee Cheung) [#&#8203;59160](nodejs/node#59160)
- \[[`51f578a3bf`](nodejs/node@51f578a3bf)] - **tools**: add support for URLs to MR commits in `merge.sh` (Antoine du Hamel) [#&#8203;59162](nodejs/node#59162)
- \[[`20be9012eb`](nodejs/node@20be9012eb)] - **tools**: bump [@&#8203;eslint/plugin-kit](https://github.com/eslint/plugin-kit) from 0.3.1 to 0.3.3 in /tools/eslint (dependabot\[bot]) [#&#8203;59119](nodejs/node#59119)
- \[[`623e264e93`](nodejs/node@623e264e93)] - **tools**: ignore CVE mention when linting release proposals (Antoine du Hamel) [#&#8203;59037](nodejs/node#59037)
- \[[`0e547e09ab`](nodejs/node@0e547e09ab)] - **tools,test**: enforce best practices to detect never settling promises (Antoine du Hamel) [#&#8203;58992](nodejs/node#58992)
- \[[`075d1968db`](nodejs/node@075d1968db)] - **util**: respect nested formats in styleText (Alex Yang) [#&#8203;59098](nodejs/node#59098)
- \[[`9791ff3480`](nodejs/node@9791ff3480)] - **(SEMVER-MINOR)** **worker**: add web locks api (ishabi) [#&#8203;58666](nodejs/node#58666)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40Ni4zIiwidXBkYXRlZEluVmVyIjoiNDEuNDYuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
NathanWalker pushed a commit to NativeScript/ios that referenced this pull request Jun 11, 2026
…kResource (#385)

Chrome DevTools no longer fetches external source maps itself when
debugging remote targets: it issues Network.loadNetworkResource to the
target and reads the result back through IO.read/IO.close. None of
these embedder-side CDP domains are implemented by V8's inspector, so
external source maps failed and apps had to fall back to bloated
inline-source-map builds.

- Handle Network.loadNetworkResource natively: resolve the URL back to
  a file under RuntimeConfig.BaseDir and reply with a stream handle
  (success:false + net::ERR_FILE_NOT_FOUND when missing).
- Implement IO.read (1MB base64 chunks; eof only on a final empty read,
  since the frontend discards data accompanying eof) and IO.close.
- Reply with a JSON-RPC error for unsupported schemes (e.g. https) so
  DevTools keeps its existing fallback of fetching from the host.
- Rewrite sourceMapURL in outgoing Debugger.scriptParsed /
  Debugger.scriptFailedToParse events from relative/file:// URLs to a
  custom nsruntime:// scheme. DevTools hard-excludes file:, data: and
  devtools: URLs from loading through the target, so without the
  rewrite it would never send Network.loadNetworkResource and instead
  try (and fail) to read device files from the host machine. data: and
  http(s) URLs are left untouched, keeping inline source maps working.
- Allow opting out via nativescript.config.ts:
  ios.disableSourceMapURLRewrite (or the same key at the top level).

Page.enable/Page.getResourceTree are not required: the frontend falls
back to a null frameId, which is optional in loadNetworkResource.

Refs: nodejs/node#58077
edusperoni added a commit to NativeScript/android that referenced this pull request Jun 11, 2026
…er fds (#1967)

* feat(inspector): serve source maps to DevTools via Network.loadNetworkResource

Chrome DevTools no longer fetches external source maps itself when
debugging remote targets: it issues Network.loadNetworkResource to the
target and reads the result back through IO.read/IO.close. None of these
embedder-side CDP domains are implemented by V8's inspector, so external
source maps failed and apps had to fall back to bloated
inline-source-map builds.

- Handle Network.loadNetworkResource natively: resolve the URL back to a
  file on disk and reply with a stream handle (success:false +
  net::ERR_FILE_NOT_FOUND when missing).
- Implement IO.read (1MB base64 chunks; eof only on a final empty read,
  since the frontend discards data accompanying eof) and IO.close.
- Reply with a JSON-RPC error for unsupported schemes (e.g. https) so
  DevTools keeps its existing fallback of fetching from the host.
- Rewrite sourceMapURL in outgoing Debugger.scriptParsed /
  Debugger.scriptFailedToParse events from relative/file:// URLs to a
  custom nsruntime:// scheme. DevTools hard-excludes file:, data: and
  devtools: URLs from loading through the target, so without the rewrite
  it would never send Network.loadNetworkResource and instead try (and
  fail) to read device files from the host machine. data: and http(s)
  URLs are left untouched, keeping inline source maps working.
- Allow opting out via nativescript.config.ts:
  android.disableSourceMapURLRewrite (or the same key at the top level).
- Serve these messages on the websocket read thread (new native
  handleMessageOnSocketThread), since the main-thread queue is
  unavailable exactly when DevTools needs source maps: the pause loop
  bypasses dispatchMessage and a busy isolate never drains the queue.
  The handler is V8-free and returns the response for Java to send on
  the receiving socket.
- Make Debugger.pause interrupt busy JS via Isolate::RequestInterrupt,
  skipped while already paused in the nested loop to avoid a spurious
  re-pause after resume.
- Vendor nlohmann/json v3.12.0 (third_party/json.hpp, header-only) for
  CDP message handling outside V8.

Ports NativeScript/ios#385 and NativeScript/ios#378 to Android.

Refs: nodejs/node#58077

* fix: timers removed from wrong looper

* fix(timers): order timers with the Java MessageQueue instead of ALooper fds

Timers were delivered through a pipe fd registered with ALooper_addFd.
Android services fd callbacks inside MessageQueue.nativePollOnce at every
message boundary, so timer callbacks and Handler messages lived in two
queues with no mutual ordering: a setTimeout(0) could fire before or
interleave around an already-queued Handler.postDelayed(0) runnable.

Timers now ride the Java MessageQueue itself via a dedicated per-runtime
TimerHandler bound to the isolate's Looper:

- Each scheduled timer enqueues one message with sendMessageAtTime, so
  timers share a single queue with Handler.post/postDelayed and fire in
  exact MessageQueue order.
- Messages are anonymous "due tokens": a native list sorted by exact
  (sub-millisecond) due time picks the earliest due timer per token,
  preserving the previous relative ordering of JS timers despite the
  millisecond-quantized Java queue.
- Due-now timers post at (long)now so they tie (FIFO) with a
  postDelayed(0) made in the same millisecond; future timers post at
  ceil(dueTime) so they never fire early.
- The background watcher thread, pipe, mutex and condition variables are
  removed; the MessageQueue does all delayed scheduling and everything
  runs on the isolate's thread with no locking. Worker isolates get the
  same behavior on their own loopers.

Also adds ordering regression tests (timers vs Handler posts), scheduled
from a java-posted runnable to avoid the >=5-level nesting clamp that
jasmine's spec chaining otherwise triggers.

Fixes timer/Handler ordering so setTimeout(0) reliably yields behind
already-queued main-thread work.
edusperoni added a commit to NativeScript/android that referenced this pull request Jun 11, 2026
…kResource

Chrome DevTools no longer fetches external source maps itself when
debugging remote targets: it issues Network.loadNetworkResource to the
target and reads the result back through IO.read/IO.close. None of these
embedder-side CDP domains are implemented by V8's inspector, so external
source maps failed and apps had to fall back to bloated
inline-source-map builds.

- Handle Network.loadNetworkResource natively: resolve the URL back to a
  file on disk and reply with a stream handle (success:false +
  net::ERR_FILE_NOT_FOUND when missing).
- Implement IO.read (1MB base64 chunks; eof only on a final empty read,
  since the frontend discards data accompanying eof) and IO.close.
- Reply with a JSON-RPC error for unsupported schemes (e.g. https) so
  DevTools keeps its existing fallback of fetching from the host.
- Rewrite sourceMapURL in outgoing Debugger.scriptParsed /
  Debugger.scriptFailedToParse events from relative/file:// URLs to a
  custom nsruntime:// scheme. DevTools hard-excludes file:, data: and
  devtools: URLs from loading through the target, so without the rewrite
  it would never send Network.loadNetworkResource and instead try (and
  fail) to read device files from the host machine. data: and http(s)
  URLs are left untouched, keeping inline source maps working.
- Allow opting out via nativescript.config.ts:
  android.disableSourceMapURLRewrite (or the same key at the top level).
- Serve these messages on the websocket read thread (new native
  handleMessageOnSocketThread), since the main-thread queue is
  unavailable exactly when DevTools needs source maps: the pause loop
  bypasses dispatchMessage and a busy isolate never drains the queue.
  The handler is V8-free and returns the response for Java to send on
  the receiving socket.
- Make Debugger.pause interrupt busy JS via Isolate::RequestInterrupt,
  skipped while already paused in the nested loop to avoid a spurious
  re-pause after resume.
- Vendor nlohmann/json v3.12.0 (third_party/json.hpp, header-only) for
  CDP message handling outside V8.

Ports NativeScript/ios#385 and NativeScript/ios#378 to Android.

Refs: nodejs/node#58077
rigor789 pushed a commit to NativeScript/android that referenced this pull request Jun 12, 2026
#1969)

* feat(inspector): serve source maps to DevTools via Network.loadNetworkResource

Chrome DevTools no longer fetches external source maps itself when
debugging remote targets: it issues Network.loadNetworkResource to the
target and reads the result back through IO.read/IO.close. None of these
embedder-side CDP domains are implemented by V8's inspector, so external
source maps failed and apps had to fall back to bloated
inline-source-map builds.

- Handle Network.loadNetworkResource natively: resolve the URL back to a
  file on disk and reply with a stream handle (success:false +
  net::ERR_FILE_NOT_FOUND when missing).
- Implement IO.read (1MB base64 chunks; eof only on a final empty read,
  since the frontend discards data accompanying eof) and IO.close.
- Reply with a JSON-RPC error for unsupported schemes (e.g. https) so
  DevTools keeps its existing fallback of fetching from the host.
- Rewrite sourceMapURL in outgoing Debugger.scriptParsed /
  Debugger.scriptFailedToParse events from relative/file:// URLs to a
  custom nsruntime:// scheme. DevTools hard-excludes file:, data: and
  devtools: URLs from loading through the target, so without the rewrite
  it would never send Network.loadNetworkResource and instead try (and
  fail) to read device files from the host machine. data: and http(s)
  URLs are left untouched, keeping inline source maps working.
- Allow opting out via nativescript.config.ts:
  android.disableSourceMapURLRewrite (or the same key at the top level).
- Serve these messages on the websocket read thread (new native
  handleMessageOnSocketThread), since the main-thread queue is
  unavailable exactly when DevTools needs source maps: the pause loop
  bypasses dispatchMessage and a busy isolate never drains the queue.
  The handler is V8-free and returns the response for Java to send on
  the receiving socket.
- Make Debugger.pause interrupt busy JS via Isolate::RequestInterrupt,
  skipped while already paused in the nested loop to avoid a spurious
  re-pause after resume.
- Vendor nlohmann/json v3.12.0 (third_party/json.hpp, header-only) for
  CDP message handling outside V8.

Ports NativeScript/ios#385 and NativeScript/ios#378 to Android.

Refs: nodejs/node#58077

* fix(inspector): clear resource streams on disconnect to prevent stale connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. inspector Issues and PRs related to the V8 inspector protocol lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Network (CDP) to support external sourcemaps

5 participants