Follow-up to #2100. A page script written as a `data:` or `blob:` URL was read as a local path, so `data:text/javascript,0//../../boot.js` became a dependency on the app's own `boot.js`. Anything with a URL scheme is now left alone, while a local path whose query holds a URL stays local. A path written with a `./` in the middle reaches the same file as one without. A dependency's file under `node_modules/` no longer wins over the app's own file of the same name. These lookups now use one index built once per app, where each used to scan every file.
HTML refs lose interior tabs and newlines before the scheme check, file: is stripped case-insensitively, and a path ending in / resolves to no file in resolve_path or a modulepreload.
Spaced HTML refs are classified as a browser reads them, only a whole node_modules directory segment marks dependency code, and remote loadURL targets stay URL nodes.
data: HTML refs no longer resolve to local files, equivalent tail spellings reach the same file, node_modules listing entries never win a tail, and tails come from one index per analysis.
A result that starts to verify mid-build can no longer prove a row with no selected result, proven needs a selected verifier result, and tied verifiers report the same gap in either order.
The ledger of what a rebuilt JavaScript app must do names, for each entry, the place in the app's map it came from. For storage uses, requests with no method and native modules listed as files, that name didn't match any node in the map, so those entries led nowhere; they now use the map's own ids. The same entry could also be listed twice, and no longer is. And when one owner in the rebuild had several records for an entry, only the first was read: test cases in the later ones were lost, and a failed check after a passing one went unnoticed. All of an owner's records are now read together, and one failed check is enough to mark the entry disproved.
Follow-up to #2087. In a `.gitignore` pattern such as `a/**\/b.js`, the slash after `**` is written with a backslash, and `**` was then read as a single `*`, so `a/x/y/b.js` wasn't ignored. `**` followed by an escaped slash now crosses folders as git reads it, and still needs at least one folder in between.
In a TypeScript project that hasn't been built, `import "./util.js"` means the file `util.ts`: the import names what the file will be called after building. Mapping such a folder left those imports unresolved, so the app's modules looked unconnected. An import or preload path ending in `.js`, `.mjs`, `.cjs` or `.jsx` now falls back to the TypeScript file beside it when no file of that exact name exists, and `.mts`/`.cts` files and more kinds of `index` file are found. The declaration files `.d.mts` and `.d.cts` are no longer taken for code, as `.d.ts` already wasn't.
Reading a source folder with its `.gitignore` files applied differed from git in four ways. A pattern starting with a backslash to mean a literal `*`, `[` or `?` was read as a wildcard. A name ending in an escaped space lost the space. `**` inside a name (`a**b.js`) crossed folders, where git treats it as one `*`. And a file under an ignored folder could be brought back by a later `!` rule, which git doesn't allow. Each now matches what `git check-ignore` reports.
The live browser and Electron capture tools had their own copy of the code that hides declared secrets, and only that copy hid two secrets that overlap: in a network recording or a stand-in built from one, `Bearer abc` and `abc123456789` in `Bearer abc123456789` left `123456789` showing. All three now use one implementation, in the analysis crate, which hides overlapping matches as one.
Saving the scripts of a web capture planned two files for URLs that differed only in letter case; on Windows and on a default Mac disk those are one file, so the second script was skipped. Paths are now compared without regard to case. A script whose URL ends in `.JS`, `.MJS` or `.CJS` no longer gets a second `.js` added, and a script captured many times is numbered `.hash.2`, `.hash.3` and so on, where each copy used to add to the last one's name until it was too long to write.
- Update `analysis::web_har::replace_needles_with` to scan each UTF-8 character
boundary for the longest matching needle and merge overlapping matched byte
spans before replacing, closing the suffix leak on partially overlapping
declared secrets in HAR inspection and stand-in builds while keeping distinct
non-overlapping adjacent matches separate for stand-in deduplication budgets.
- Export `encode_query`, `contains_ascii_ci`, and `replace_needles_with` from
`analysis::web_har` and call them directly from `engine::tools::web_common`,
removing the duplicate implementations so all three redactors stay in sync.
An indexed source map (one made of sections) always reported 0 sources with embedded content, because only the top level was counted; the count now includes every inline section, nested ones too. A stand-alone map named like `app.map.map` also lost both suffixes when its script name was worked out; only the last `.map` is removed now.
Comparing two versions of a JavaScript app matched each old module against every rule before moving to the next, so an earlier module's weaker match (same structure, or same id) could take a new module that a later one matched exactly, and one new module could be reported twice. Modules are now matched one rule at a time across all of them, strongest first, and each new module is claimed once.
A value the person declared as hidden could still appear in a network capture view or a stand-in when it was written the way a form posts it (spaces as `+` with other characters percent-encoded), with mixed-case percent escapes, or as an encoded form field name. Those spellings are now matched, without regard to letter case, with the longest spelling replaced first.
An application graph dropped edges past 4 x max_nodes without saying so, and js_app_map reported complete coverage even for a graph cut by its node or edge cap. The builder now counts edges the cap turns away and records an edge_cap limitation beside node_cap, and js_app_map marks coverage partial when either cap cut the graph, on every module page.
A source-to-bundle comparison with more scripts than max_rows reported the examined window's counts as if they covered the whole tree, and its count of bundle units without a source was the capped row count. It now says how many scripts were examined beside the total, counts every unclaimed unit while still listing at most max_rows, and marks a capped result with a rows_capped limitation and partial coverage.
An index-map section that points at an external map, which is never fetched, adds no sources, so an application graph treated the map's list as complete. Such sections are now counted (through nested index maps), the graph names them in a limitation, and comparing a reference source tree with the bundle reports an otherwise unmatched source as uncertain with partial coverage instead of absent.
A map with malformed mappings or section offsets was reported unreadable, although its sources list is usually whole, and the list is all an application graph keeps. A new sourcemap::parse_sources reads the sources, content, names and ignore list without decoding mappings or checking section offsets; the application graph re-reads a map parse refuses for those reasons this way, lists its sources with a source_map_mappings_unreadable limitation, and compares them as usual. A map whose decodable mappings name a source past the end of its list, or with a malformed section, is still unreadable.
A source map that was malformed, had an undecodable data URL or was listed but not loaded left its sources looking absent, so a source comparison reported them as confirmed missing. Such a map is now marked unreadable with a limitation, and the comparison reports otherwise unmatched sources as uncertain with partial coverage. A stand-alone .map beside an analysed script is read like a referenced one; other .map files stay listed and unread, so they can't make a comparison uncertain or match code that doesn't ship.
Follow-up to #1703. A sections array of non-objects could cost several times the old parser's memory, skipped values weren't checked as a full read checks them so some broken maps read as valid, entries a repeated key replaces still used the budget, and the analyzer read a map refused at a limit as one with no sources. Index-map sections now count against the entry budget and non-map sections stay small, skipped values get the same string, number and nesting checks, a replaced list is freed and gives its entries back, the default limit is 4,000,000 so a million sources with content fit, and a map refused at any of the parser's limits leaves its sources uncertain with a limitation, while a malformed map is read as before.
When a source map's inventory was cut by its limits, the source-to-bundle comparison searched only the retained names and reported an omitted source as confirmed unmatched. Sources with no observed match now go in a separate uncertain_sources list with the reason source_map_inventory_truncated, the result says the inventory was truncated, and the evidence carries a limitation and partial coverage; positive matches are unchanged.
A small source map could expand to gigabytes when its sourceRoot was copied into every source name, and the full list was built before the application analyzer kept 5,000 of them. Source lists are now built within an entry and byte budget shared across sections and an application's maps, checking each expanded path's length before allocating it; when only a prefix fits, the result says it was truncated and the analysis notes it as a limitation. A pitfalls entry records the rule.
The application graph recognizes a worker entry point but then follows its spawn edge while assigning the parent's role. Worker modules, their ordinary dependencies and their endpoint evidence consequently appear as `main`, `page` or `package`. The later worker-role pass cannot correct a role that was already assigned. Use the existing worker/service-worker/utility-process edge classification to stop parent-role traversal at execution-context boundaries. Worker roots still receive their own role and propagate it through ordinary imports. Spawn edges remain in the graph, and a module also directly imported by the parent retains the existing role precedence.
A package with 52 reachable modules loses the final module's role when each hop repeats the same `require()` 2,000 times. The graph resolves those imports, but role propagation charges its 100,000-step limit for duplicate queue entries, eventually leaving reachable modules as `unknown`. Mark modules in the existing role map before enqueueing them. Repeated imports, cycles and shared dependencies then use one queue entry per newly discovered module. The limit remains 100,000 newly discovered modules per assignment, and the existing main/preload/renderer/page/worker precedence stays intact. Inline scripts continue to inherit their page's role.
A module keyed by `0x10` and a loader call written as `16` produced different identities. Numeric separators and exponent notation caused the same problem, including dangling `requires` targets in the application graph. Different spellings of one numeric dependency could also occupy separate list entries. Use the existing syntax library's JavaScript number conversion for numeric module keys, loader arguments, browserify mappings and chunk IDs. Explicitly enable its already-present `to_js_string` feature. String identifiers retain their literal spelling, including strings such as `"0x10"` that identify a different property from numeric `0x10`.
A webpack wrapper can have a loader parameter named `r` while a nested function uses its own unrelated parameter with the same spelling. The dependency visitor treated both calls as module loads, adding false `requires` edges to the application graph. Resolve loader calls against the wrapper parameter's semantic binding. This retains closures that capture the real loader, distinguishes function/arrow parameters, block and catch bindings, and avoids treating the placeholder for a destructured parameter as an actual loader name. First-seen ordering and dependency deduplication stay intact.