Skip to content

caesarhnz/copy-page-source

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy Page Source — Chrome Extension

A Chrome extension built to extract clean, relevant HTML from any website — optimized for pasting into Claude Code or other LLM tools without blowing up the context window.

Features

  • Section Detection — Automatically detects and lists all semantic sections of a page (Header, Navbar, Hero, Footer, etc.) based on HTML tags, ARIA roles, class names, and common naming patterns
  • Drill-Down — Expand any section to see its children. Useful when the entire page is wrapped in a single <main> element
  • Visual Highlighting — Selected sections are highlighted with a blue overlay directly on the page, so you can see exactly what you're copying
  • 3 Output Modes:
    • Clean — Strips scripts, styles, SVGs, tracking attributes, inline styles, and HTML comments. Typically reduces size by ~50%
    • Text Only — Extracts just the visible text content. Smallest output
    • Raw HTML — Copies the unmodified source code
  • Size Warnings — Shows estimated output size before copying. Yellow warning at ~50 KB, red warning at ~150 KB
  • One-Click Copy — Selected sections are cleaned and copied to clipboard, ready to paste into Claude Code

Installation

  1. Download or clone this repo
  2. Open chrome://extensions in Chrome
  3. Enable Developer mode (top right)
  4. Click Load unpacked and select this folder

Usage

  1. Navigate to any website
  2. Click the extension icon
  3. Browse the detected sections — expand with ▶ to drill into children
  4. Check the sections you need
  5. Choose output mode (Clean / Text / Raw)
  6. Click copy — paste into Claude Code

Why?

Pasting an entire website's HTML into an LLM context window is wasteful. Most of the source code is scripts, styles, tracking pixels, and SVG noise. This extension lets you surgically extract just the parts you care about — a hero section for design inspiration, a pricing table for layout reference, a nav structure for implementation guidance.

Tech Stack

  • Chrome Manifest V3
  • Vanilla JavaScript (no dependencies)
  • Content script injection via chrome.scripting API

About

Chrome extension to extract clean HTML sections from websites — optimized for Claude Code and LLM context windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors