Skip to content

Extract Next.js build manifest, page routes, and JavaScript file paths from websites using headless automation

Notifications You must be signed in to change notification settings

Jhounx/showmethenext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

showmethenext

A command-line tool to extract JavaScript file paths and build manifest information from Next.js applications using headless Chrome automation.

Description

showmethenext is a Go-based tool that uses Chrome DevTools Protocol (via chromedp) to extract JavaScript file information from Next.js applications. It can retrieve page routes, JavaScript file paths, and build manifest data from websites by analyzing the __BUILD_MANIFEST object in the browser.

Features

  • Extract page routes from Next.js applications
  • Get complete build manifest with all JavaScript and CSS file paths
  • Generate full URLs for JavaScript files (with -full-url flag)
  • Output results in JSON format or plain text (one per line)
  • Save results to a file
  • Process multiple URLs concurrently with configurable thread count
  • Filter and extract only JavaScript files

Installation

Prerequisites

  • Go 1.25.4 or later
  • Chrome or Chromium browser installed

Build from Source

git clone https://github.com/Jhounx/showmethenext.git
cd showmethenext
go build -o showmejs main.go

Docker

Build the Docker Image

docker build -t showmethenext .

Run with Docker

# Basic usage
echo "https://example.com" | docker run -i showmethenext

# Get complete build manifest
echo "https://example.com" | docker run -i showmethenext -js

# Extract JavaScript files with full URLs
echo "https://example.com" | docker run -i showmethenext -js -jj -full-url

# Save output to a file (using volume mount)
echo "https://example.com" | docker run -i -v $(pwd):/output showmethenext -js -full-url -o /output/results.json

# Process multiple URLs
cat urls.txt | docker run -i showmethenext -js -threads 10

Docker Compose (Optional)

You can also create a docker-compose.yml file:

version: '3.8'
services:
  showmethenext:
    build: .
    stdin_open: true
    tty: true
    volumes:
      - ./output:/output

Then use it:

echo "https://example.com" | docker-compose run --rm showmethenext -js -full-url -o /output/results.json

Usage

The tool reads URLs from standard input (stdin) and processes them concurrently.

Basic Usage

# Get page routes
echo "https://example.com" | ./showmejs

# Get complete build manifest
echo "https://example.com" | ./showmejs -js

Command-Line Flags

Flag Description Default
-threads Number of concurrent workers (threads) 5
-js Enable full __BUILD_MANIFEST extraction false
-o Output file path to save results (stdout)
-full-url Return full URLs for .js files in format: url/_next/js_path false
-jj Just JS: return only .js file URLs, one per line false

Examples

Extract Page Routes

echo "https://www.ifood.com.br/" | ./showmejs

Output:

{
  "pages": ["/", "/404", "/about"],
  "url": "https://www.ifood.com.br/"
}

Get Complete Build Manifest

echo "https://www.ifood.com.br/" | ./showmejs -js | jq

Output:

{
  "urls": {
    "/": [
      "static/chunks/7d0bf13e-822f25f772721f80.js",
      "static/chunks/7235-7d3a858c47582b51.js",
      "static/css/c87183fbe96e3d28.css"
    ],
    "/404": [
      "static/chunks/pages/404-ee7066db01dc9ae9.js"
    ]
  },
  "url": "https://www.ifood.com.br/",
  "files": [
    "static/chunks/7d0bf13e-822f25f772721f80.js",
    "static/chunks/7235-7d3a858c47582b51.js",
    "static/chunks/pages/404-ee7066db01dc9ae9.js"
  ]
}

Get Full URLs for JavaScript Files

echo "https://www.ifood.com.br/" | ./showmejs -js -full-url | jq

Output:

{
  "urls": {
    "/": [
      "https://www.ifood.com.br/_next/static/chunks/7d0bf13e-822f25f772721f80.js",
      "https://www.ifood.com.br/_next/static/chunks/7235-7d3a858c47582b51.js"
    ],
    "/404": [
      "https://www.ifood.com.br/_next/static/chunks/pages/404-ee7066db01dc9ae9.js"
    ]
  },
  "url": "https://www.ifood.com.br/",
  "files": [
    "https://www.ifood.com.br/_next/static/chunks/7d0bf13e-822f25f772721f80.js",
    "https://www.ifood.com.br/_next/static/chunks/7235-7d3a858c47582b51.js",
    "https://www.ifood.com.br/_next/static/chunks/pages/404-ee7066db01dc9ae9.js"
  ]
}

Extract Only JavaScript Files (One Per Line)

echo "https://www.ifood.com.br/" | ./showmejs -js -jj

Output:

static/chunks/7d0bf13e-822f25f772721f80.js
static/chunks/7235-7d3a858c47582b51.js
static/chunks/pages/index-dcb950bd626bb71e.js

Extract JavaScript Files with Full URLs (One Per Line)

echo "https://www.ifood.com.br/" | ./showmejs -js -jj -full-url

Output:

https://www.ifood.com.br/_next/static/chunks/7d0bf13e-822f25f772721f80.js
https://www.ifood.com.br/_next/static/chunks/7235-7d3a858c47582b51.js
https://www.ifood.com.br/_next/static/chunks/pages/index-dcb950bd626bb71e.js

Save Results to File

echo "https://www.ifood.com.br/" | ./showmejs -js -full-url -o results.json

Process Multiple URLs

cat urls.txt | ./showmejs -js -threads 10

Where urls.txt contains:

https://example.com
https://another-site.com
https://third-site.com

Combine with Other Tools

# Extract JS files and download them
echo "https://www.ifood.com.br/" | ./showmejs -js -jj -full-url | xargs -I {} wget {}

# Filter specific files
echo "https://www.ifood.com.br/" | ./showmejs -js -jj -full-url | grep "pages"

Output Format

Standard Mode (without -js)

Returns a JSON object with:

  • pages: Array of page routes
  • url: The processed URL

JavaScript Mode (with -js)

Returns a JSON object with:

  • urls: Map of routes to their associated files
  • url: The processed URL
  • files: Array of all unique JavaScript files found

Just JS Mode (with -jj)

Returns plain text, one JavaScript file URL per line (no JSON formatting).

Full URL Mode (with -full-url)

When combined with -js, all JavaScript file paths are converted to full URLs in the format:

{base_url}/_next/{js_path}

CSS files are filtered out when -full-url is active.

Notes

  • The tool uses headless Chrome to navigate to websites and extract build manifest data
  • Each URL has a timeout of 90 seconds
  • The overall process has a timeout of 10 minutes
  • Results are written thread-safely when using the -o flag
  • When -full-url is active, CSS files are excluded from the output
  • The -jj flag returns only JavaScript files, one per line, making it easy to pipe to other tools

Requirements

For Local Installation

  • Go 1.25.4+
  • Chrome/Chromium browser
  • Network access to target URLs

For Docker

  • Docker installed
  • Network access to target URLs (Docker will handle Chrome/Chromium automatically)

About

Extract Next.js build manifest, page routes, and JavaScript file paths from websites using headless automation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published