A simple bookmarklet that captures a screenshot of the current page and downloads it as a PNG. There are two variants:
- One that saves a single 1920×1080 image
- One that also saves a 200×150 thumbnail alongside the main image
No data is sent anywhere. Images are generated in-memory and downloaded directly by your browser.
ss.js: Readable source for a single 1920×1080 screenshotss-with-thumb.js: Readable source that also generates a 200×150 thumbnailmin-ss.js: Minified bookmarklet for production use (single image)min-ss-with-thumb.js: Minified bookmarklet for production use (image + thumbnail)min.py: Python script that minifies the readable sources into themin-*files (usesjsmin)
- On click, the bookmarklet first looks for
html2canvas. If present, it captures the rendered DOM:html2canvas(document.documentElement). - If
html2canvasis not present or fails, it falls back to native screen capture vianavigator.mediaDevices.getDisplayMedia, requesting the current tab/window. The browser will prompt you to choose what to share. - The captured image is resized to a fixed size of 1920×1080 (
TARGET_WIDTH/TARGET_HEIGHT) before download. - Files are named using the site/page context and a counter:
<page>-screenshot-<n>.png. - The thumbnail variant also downloads
<page>-screenshot-<n>-thumb.png(200×150). - A simple counter is tracked in
localStorageunderss_bookmarklet_screenshot_counter(with a safe in-memory fallback iflocalStorageis unavailable).
You will create a browser bookmark whose URL is the JavaScript code from one of the min-* files.
- Open
min-ss.js(single image) ormin-ss-with-thumb.js(image + thumbnail) in your editor or GitHub and copy its entire contents. - Create a new bookmark in your browser:
- Chrome/Edge/Brave
- Show the bookmarks bar if hidden (Ctrl+Shift+B)
- Right-click the bar → Add page…
- Name: e.g., "Screenshot" or "Screenshot + Thumb"
- URL: paste the code you copied (it must start with
javascript:) - Save
- Firefox
- Right-click the bookmarks toolbar → New Bookmark…
- Name: as you like
- Location (URL): paste the code (must start with
javascript:) - Add
To use: navigate to any page and click the bookmarklet. Your browser may prompt for permission to capture a tab/window; choose the current tab for best results.
- Base filename:
<page>-screenshot-<n>.png<page>is derived from the hostname (or page title as a fallback), lowercased and slugified<n>increments per screenshot usinglocalStorage
- Thumbnail variant adds:
<page>-screenshot-<n>-thumb.png
Minified files are already committed (min-ss.js, min-ss-with-thumb.js). If you modify the readable sources, regenerate the minified files as follows:
Requirements:
- Python 3.x
jsminpackage
Install dependency:
- Windows PowerShell:
python -m pip install jsmin(orpy -m pip install jsmin) - macOS/Linux:
python3 -m pip install jsmin
Run the minifier from the repo root:
- Windows PowerShell:
python min.py(orpy min.py) - macOS/Linux:
python3 min.py
This will:
- Read
ss.js→ writemin-ss.js - Read
ss-with-thumb.js→ writemin-ss-with-thumb.js
Edit ss.js or ss-with-thumb.js as needed, then re-run min.py.
- Screenshot size: change
TARGET_WIDTHandTARGET_HEIGHT(defaults: 1920×1080) - Thumbnail size (thumb variant): change
THUMB_WIDTHandTHUMB_HEIGHT(defaults: 200×150) - Naming: update
getPageName()or the filename template in the save functions
- The browser asks what to share
- Choose the current tab (or window) to capture what you see. This is required by browser security when using screen capture.
- Nothing happens when clicked
- Ensure the bookmark URL begins with
javascript:and the code is unmodified. - Some pages block bookmarklets in iframes; try opening the page in a top-level tab.
- Ensure the bookmark URL begins with
- Only one of the files downloads, or the browser blocks downloads
- Allow multiple automatic downloads for the site in the browser’s permissions if prompted.
html2canvaspath- If the page does not already include
html2canvas, the bookmarklet will automatically fall back to screen capture.
- If the page does not already include
- The code does not make network requests or upload content. Images are generated as in-memory blobs and downloaded locally.
- When using screen capture (
getDisplayMedia), the browser’s built-in permission prompt appears. Nothing is captured until you explicitly choose a tab/window to share.
- Works best in modern Chromium-based browsers and recent Firefox versions.
- If you keep this repository on GitHub, you can point collaborators to the
min-*files to create their bookmarklets quickly.