Skip to main content
Version: 2.0.1-alpha.1

Lazyload Methods

The lazyload module runs a set of discovery methods to find JavaScript files on the target. Each method is named after its source file and targets a specific technique (script-tag extraction, manifest parsing, brute-force, etc.).

You can control which methods run using the --include-methods (whitelist) and --exclude-methods (blacklist) flags on the lazyload command.

Listing methods at runtime

js-recon lazyload --list-methods
js-recon lazyload --list-methods next_js

Method reference

Next.js (next_js)

Method nameDescription
next_GetJSScriptExtracts <script src> tags from the rendered landing page HTML.
next_GetLazyResourcesBuildManifestJsParses _buildManifest.js to enumerate all chunk URLs.
next_GetLazyResourcesWebpackJsLoads the page via Puppeteer, scans all captured JS files for webpack chunk-URL builder functions (__webpack_require__.u), and executes approved ones to enumerate chunk URLs.
next_SubsequentRequestsRe-crawls using a list of extracted URL paths to fetch RSC/dynamic chunks loaded on subsequent navigation (requires --subsequent-requests).
next_scriptTagsSubsequentRequestsVisits extracted URL paths and collects script tags from each page's HTML (requires --subsequent-requests).
next_promiseResolveAnalyzes Promise.all / __webpack_require__.e patterns inside JS files to resolve dynamically loaded chunk IDs.
next_parseLayoutJsParses App Router layout.js files to enumerate nested route dependencies (Next.js 13+ only).
next_bruteForceJsFilesBrute-forces .map and related chunk files based on the set of already-discovered JS URLs. Runs last as a fallback.
next_getClientSidePathsHarvests <a href> links from pages to expand the crawl frontier.
next_routerStateForgeFor routes that redirect an unauthenticated request, retries as an RSC fetch with a forged Next-Router-State-Tree header claiming a known ancestor path segment is already client-rendered. Some Next.js apps put their only auth check inside a layout component instead of middleware; a forged claim can cause that layout's component function to be skipped, disclosing protected content. Dynamic route segments (e.g. app/organizations/[org]/layout.js) require guessing the real param name from a fixed wordlist (--rsc-param-bruteforce-limit controls a bounded fallback that harvests additional candidate names from already-fetched RSC response bodies once the wordlist is exhausted).
next_serverActionIdScanRuns after every chunk is downloaded; scans each .js file for createServerReference("<id>", ...) call sites (same ID-format validation as map's AST-based Server Action resolver, /^[0-9a-f]{40,}$/i, applied directly to raw chunk text) and writes any discovered IDs to server_action_ids.json in the target's output directory ({ actionIdsByFile, allActionIds }). Disclosure only — no action is invoked; a Server Action ID shipped in a public chunk for a page the crawl couldn't reach unauthenticated is itself a disclosure signal.

Vue.js (vue)

Method nameDescription
vue_discoverJsFilesParses the entry page HTML and follows <script src> tags and ESM import maps.
vue_recursiveClientSidePathDownloadRecursively runs the discovery pipeline on every client-side route path found.
vue_stringJsFilesScans downloaded JS files for string-embedded chunk paths.
vue_getClientSidePathsExtracts client-side route paths from Vue Router configuration.
vue_pageSrcFetches additional JS from page <script src> attributes.
vue_reconstructSourceMapsFetches .js.map files and reconstructs original sources.
vue_RuntimeJsLocates and processes the Vue runtime JS entry file.
vue_viteMapDepsResolves __vite_mapDeps references used by Vite to preload module dependencies.
vue_sourcemapExtractExtracts inline sourcemap data URIs from downloaded JS.
vue_jsImportsFollows ESM import statements recursively to discover transitively-loaded files.
vue_severalJsFilesHomeHandles apps that serve multiple JS entry files from the home page.
vue_SingleJsFileOnHomeHandles apps that serve a single JS entry file from the home page.

Nuxt.js (nuxt_js)

Method nameDescription
nuxt_getFromPageSourceExtracts JS file URLs from <script src> tags in the server-rendered HTML.
nuxt_stringAnalysisJSFilesScans downloaded JS for string-embedded paths to additional chunks.
nuxt_astParseAST-parses downloaded JS files to resolve dynamic import statements and chunk references.

Nuxt.js discovery also probes /_nuxt/builds/latest.json and derives /_nuxt/builds/meta/<id>.json from it — these files are fetched at runtime by the Nuxt client for incremental-deployment support but are never referenced from HTML or JS string literals, so they are invisible to all other discovery steps. This step always runs and is not listed by --list-methods nuxt_js or selectable via --include-methods/--exclude-methods.

Svelte / Astro (svelte)

Method nameDescription
svelte_getFromPageSourceExtracts JS file URLs from the server-rendered HTML. Handles three patterns: <link rel="modulepreload"> tags, <script src="..."> tags, and — for SvelteKit adapter-node targets — inline <script> bodies containing import("...") calls (the Promise.all([import(...)]) boot pattern emitted by the Node adapter).
svelte_getVersionJsonProbes /<appDir>/version.json (default /_app/version.json). SvelteKit generates this file at build time for the updated store but never references it from any HTML tag or import() call, so it is invisible to all other discovery steps. The appDir is inferred from entry-point URLs already found; defaults to _app.
svelte_stringAnalysisJSFilesScans downloaded JS for string-embedded paths to additional chunks and source maps.
svelte_recursivePageCrawlCrawls same-origin HTML pages found via <a href> and <link href> tags, running the full JS-discovery pipeline on each.
svelte_discoverPagesFromJsScans downloaded JS for embedded page path strings (e.g. /admin, /debug) and visits each page to discover Astro island component URLs.

Angular (angular)

Method nameDescription
angular_getFromPageSourceExtracts JS file URLs from <script src> tags in the server-rendered HTML.
angular_getFromMainJsAnalyzes the detected main.js entry bundle to discover lazy-loaded chunk references.

React (react)

Method nameDescription
react_getScriptTagsExtracts <script src> tags and <link rel="modulepreload"> hints from the page HTML (covers Vite vendor chunks).
react_webpackChunkPathsDetects and executes webpack chunk-path builder functions (CRA / custom webpack configs).
react_followImportsRecursively follows ESM import statements and Vite __vite_mapDeps references across all discovered files.
react_sourcemapUrlsCollects .js.map URLs for every discovered JS file and queues them for download.

Interaction between --include-methods and --exclude-methods

  • If --include-methods is provided, only the listed methods run; all others are skipped.
  • If --exclude-methods is provided, all methods except the listed ones run.
  • Providing both flags at the same time is not recommended — --include-methods takes priority.
  • Method names are case-sensitive and must match exactly. An invalid name exits with exit code 22.