1.2 KiB
1.2 KiB
Local Chrome Screenshot Extension (Unpacked)
This is a local-only setup (no publishing) that:
- Captures the visible tab as a PNG from a Chrome extension popup.
- Sends it to a local HTTP server on
127.0.0.1. - Extracts simplified page content (text + a pruned “content tree”) from the active tab.
- The server saves it into
./screenshots/and optionally runs a local script.
1) Start the local server
From the project root:
python3 tools/local_screenshot_bridge.py --port 8765 --out-dir screenshots --run bash scripts/on_screenshot.sh
Notes:
- The server listens on
http://127.0.0.1:8765/screenshot. - If you omit
--run ..., it will only save files. - If
--run ...is set, it appends two args to the command:<png_path>then<meta_path>
2) Load the extension (unpacked)
- Open Chrome:
chrome://extensions - Enable "Developer mode"
- Click "Load unpacked"
- Select:
chrome_screenshot_ext/
3) Use it
- Click the extension icon.
- Confirm the endpoint is
http://127.0.0.1:8765/screenshot. - Click "Capture".
Saved files land in screenshots/:
YYYYMMDDTHHMMSSZ-<title-slug>.pngYYYYMMDDTHHMMSSZ-<title-slug>.jsonYYYYMMDDTHHMMSSZ-<title-slug>.content.json