$ show PactInteractive/image-downloader
Image Downloader is a Chrome extension (Manifest V3) that enables users to browse, filter, and download images from web pages. The extension features a popup UI, side panel, and options page for configuring download behavior. It uses Preact with Signals for state management, Tailwind CSS for styling, and includes sophisticated image processing capabilities like deduplication, resolution-based filtering, and format detection. The architecture consists of a background service worker handling downloads, content scripts for image discovery, and multiple UI interfaces (popup, side panel, options). Key strengths include well-isolated reusable components for image deduplication and discovery, comprehensive test coverage, and modern build tooling with Bun.
The LLM identified 3 files worth highlighting for reuse:
Implements sophisticated image deduplication that handles URL normalization, extension-based format priority (PNG > JPG > WEBP > etc.), resolution detection, and special cases like data URIs, blob URLs, query parameters, and resolution suffixes (@2x, @3x, _V1_FMjpg_UY...). Low coupling (only depends on unique utility) makes it highly reusable in other image processing contexts.
Extracts images from web pages using multiple techniques: img/src, img/data-src, img/srcset, a/href, background-image CSS, and shadow DOM handling. Converts relative URLs to absolute, handles various image formats, and preserves discovery order. Zero dependencies and self-contained design make it immediately reusable for web scraping or image discovery tasks.
Custom hook that extracts image statistics (dimensions, file size, format) using the Performance API for accurate sizing. Handles data URIs, blob URLs, and various image formats with intelligent MIME type detection. Includes LRU caching mechanism and fallback strategies for extension-less URLs. Demonstrates advanced handling of edge cases in image metadata extraction.