A Chrome extension that extracts JavaScript files and their corresponding source maps from Next.js websites, preserving the directory structure for easy analysis.
- Extract all Next.js JavaScript files from any website
- Optionally include source map (.map) files
- Preserve directory structure in the downloaded ZIP file
- Works with Cloudflare-protected websites
- User-friendly progress indicators
- Handles files up to 10MB in size
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/
- Enable "Developer mode" (toggle in the top-right corner)
- Click "Load unpacked"
- Select the
nextjs-extractor
directory
- Visit any website built with Next.js
- Click the extension icon in your browser toolbar
- Check or uncheck "Include sourcemap files" as needed
- Click "Extract and download all Next.js files"
- Wait for the extraction process to complete
- Save the downloaded ZIP file
After downloading the ZIP file, you can use the included extract-sourcemap.js
Node.js script to extract the original source code from the source maps:
- Extract the downloaded ZIP file
- Install the required dependency:
npm install source-map
- Run the script on a directory containing source map (.map) files:
node extract-sourcemap.js /path/to/extracted/zip/_next/static/chunks
This extension:
- Searches the current page for Next.js JavaScript file references
- Downloads each JavaScript file and optionally its source map
- Creates a ZIP archive with the original directory structure preserved
- Provides the ZIP file for download
- Built for Chrome using Manifest V3
- Uses content scripts to extract file references from the page
- Processes files in the background script using JSZip
- Converts the ZIP to a Data URL for download (files up to 10MB)
- Leverages the Chrome downloads API for file saving
- This extension only accesses the current tab when you click the extension icon
- No data is sent to any server - all processing happens locally in your browser
- The extension requires permissions only for the current website you're viewing
MIT License
- JSZip for ZIP file creation
- Source Map library for source map processing