Chromium MV3 · WXT Framework Chrome DevTools Protocol (CDP) Up to 8K Super-Sampled

Webshot

Ultra-high-resolution screenshots (up to 8K), native Chrome DevTools Protocol rendering, and full-page capture for production web applications and localhost development servers.

Beyond-Viewport Capture

Unlike conventional extensions that perform slow, jittery scroll-and-stitch sequences, Webshot commands Chromium's Blink compositor via CDP to rasterize the entire document layout in a single 1-shot pass.

Localhost & SPA Aware

Full-page capture that works reliably on complex Single Page Applications (Next.js, Vite, React) where internal containers (#root, #__next, overflow-y: auto) hide true heights from standard scroll APIs.

Studio Automation Suite

Pre-shutter automations strip cookie consent banners, GDPR notices, and chat widgets, while redaction engines obscure sensitive PII (emails, cards, IPs) directly before capturing.

Core Capabilities

Four dedicated capture engines.

Engine 01

Visible Screen (Super-Sampled)

Render viewports at 1080p, 1440p, 4K, 8K, or arbitrary dimensions. Dynamically multiplies device pixel scale factor before capture to output publication-grade typography and vector sharpness.

Engine 02

1-Shot Full Page Capture

Invokes CDP Page.captureScreenshot with captureBeyondViewport: true. Eliminates repeated sticky navigation bars, sliced text seams, and canvas memory stitching allocation failures.

Engine 03

Localhost & SPA Support

Engineered for development environments (localhost, 127.0.0.1). Inspects nested scroll containers (#root, #__next, main, [role="main"]) to compute true boundary heights.

Engine 04

Element Isolation & Smart Detection

Interactive DOM inspector to point, hover, and capture specific nodes with sub-pixel bounding-box precision, plus smart-subject detection for clean isolation of primary article bodies.

Automation Suite

Clean captures before the shutter triggers.

Clutter Cleaner

Automatically detects and removes cookie consent banners, GDPR dialogs, floating promotional popups, and third-party chat widgets (Intercom, HubSpot, Drift, Zendesk).

Automated PII Redaction

In-page TreeWalker regex engine detects and obscures sensitive personal data (emails, phone numbers, credit card sequences, IPv4 addresses) prior to pixel rasterization.

Forced Dark Mode

Emulates CSS media feature prefers-color-scheme: dark directly at the browser compositor level to force dark themes on supported sites without manual toggling.

Lazy-Load Trigger

Automated micro-scroll sweep forces img[loading="lazy"] assets, progressive web fonts, and dynamically mounted components to evaluate and load before capture.

macOS Window Frame

Composites an Apple-style window title bar complete with traffic light buttons, glass drop shadow, and rounded corner framing around the exported image.

Countdown Staging Timer

Configurable 2s, 5s, or 10s capture delays allowing developers to stage dropdown menus, active tooltips, modal sheets, and hover interactions effortlessly.

Under The Hood

Hardware compositor pipeline via CDP.

Instead of executing hundreds of iterative window.scrollTo calls and stitching canvas tiles in browser memory, Webshot queries true layout metrics via Page.getLayoutMetrics and commands Blink's compositor to draw the full page surface in a single rasterization pass:

TypeScript · CDP Beyond-Viewport Command entrypoints/background.ts
await chrome.debugger.sendCommand({ tabId }, 'Page.captureScreenshot', {
  format: 'png',
  fromSurface: true,
  captureBeyondViewport: true,
  clip: { x: 0, y: 0, width: totalWidth, height: totalHeight, scale: 1 }
});

Texture Limit Safeguard

Chromium GPU backends impose a hard surface boundary of 16,384px. Webshot computes effectiveScale = Math.min(targetScale, Math.floor(16384 / totalHeight)) so long documents never trigger texture allocation faults.

Zero-IPC Direct Download

When decorative framing is disabled, screenshots stream directly from the background service worker via chrome.downloads.download. Raw pixel blobs never transit offscreen DOMs unless post-processing is active.

Technical Architecture

Modular Chromium MV3 architecture.

entrypoints/background.ts Service Worker: CDP session manager, capture engine, direct downloader
entrypoints/content.ts Content Script: SPA container detection, clutter removal, PII redactor
entrypoints/offscreen/ Offscreen Document: Canvas compositing for macOS window framing
entrypoints/popup/ Extension UI: Glassmorphic panel with tactical shutter and resolution selectors
entrypoints/shared/ TypeScript contracts, profile definitions, message types, and device profiles
entrypoints/studio/ Annotation canvas for markup, blur boxes, arrows, and final export pipeline
wxt.config.ts WXT framework configuration, manifest definitions, and permission boundaries

Security & Permissions

Explicit host and debugger privileges.

Permission Architectural Purpose
debugger Attaches to the active tab to execute CDP emulation and native screenshot commands.
downloads Saves captured images directly to the user's Downloads/Webshot/ directory.
scripting Dynamically executes content helpers on tabs for SPA height detection and banner cleanup.
offscreen Hosts background canvas processing for optional macOS window framing and drop shadows.
tabs Identifies active tab metadata including page title, layout dimensions, and target URL.
host_permissions Permits capture execution on all web origins, including localhost and 127.0.0.1.

Local Development

Build and run unpacked.

01

Clone repository & install

Requires Node.js 18.x or 20.x+ and npm.

git clone https://github.com/thesatyamjain/webshot.git && cd webshot && npm install

02

Compile & Type-check

Validates strict TypeScript types across all entrypoints.

npm run compile

03

Build extension bundle

Compiles optimized MV3 artifacts into .output/chrome-mv3.

npm run build

04

Load unpacked in Chrome, Edge, or Brave

Navigate to chrome://extensions/, toggle Developer mode, click Load unpacked, and select webshot/.output/chrome-mv3.