How gildas-lormeau/singlefile works
SingleFile is a browser extension (with a separately documented CLI) that captures a web page as a self-contained HTML archive. The central flow runs from a toolbar, menu, or shortcut request through background task orchestration, page/frame capture, then foreground or background saving and optional upload. Other documented workflows include batch and automatic saves, selection/frame capture, page annotation, configurable profiles, and archive editing. The graph combines excerpted dispatch and calls with README-described capabilities; links for unsampled subsystems are shown only when documented, and some are left unconnected where wiring is not evidenced.
Main entry points: index.js Background router · downloads.js Save orchestration · content.js Page capture · bg Toolbar and menus
Components 24
Extension interaction
- Background router
src/core/bg/index.js - Toolbar and menus
src/ui/bg - Capture UI
src/ui/content/content-ui.js
Capture and processing
- Capture tasks
src/core/bg/business.js - Page capture
src/core/content/content.js - Frame capture
src/core/content/content-frames.js - Resource fetching
src/lib/single-file/fetch/content/content-fetch.js - Archive generation
lib/single-file-archive.js - Capture API
src/index.js
Save and export
- Save orchestration
src/core/bg/downloads.js - Foreground download
src/core/common/download.js - Browser download
src/core/bg/download-util.js - Chunk serialization
src/lib/yabson/yabson.js - Cloud destinations
src/lib - Proof of existence
src/lib/woleet/woleet.js
Configuration and automation
- Profiles and options
src/core/bg/config.js - Automatic saves
src/core/bg/autosave.js - Batch save
src/ui/bg/ui-batch-save-urls.js - Tab management
src/core/bg/tabs.js
Archive editing
- Archive editor
src/ui/content/content-ui-editor-web.js - Editor coordination
src/core/bg/editor.js - MHTML conversion
src/lib/mhtml-to-html/convert.js
Other components
- User
- Browser and cloud services
Connections 26
- User → Toolbar and menus: requests capture
- Toolbar and menus → Background router: sends messages
src/core/bg/index.js - Background router → Capture tasks: dispatches tasks
src/core/bg/index.js - Capture tasks → Capture API: injects scripts
src/core/bg/business.js - Capture API → Resource fetching: uses fetch
src/index.js - Page capture → Resource fetching: fetches resources
src/core/content/content.js - Page capture → Frame capture: captures frames
- Page capture → Capture UI: updates progress
src/core/content/content.js - Capture tasks → Page capture: requests capture
- Page capture → Save orchestration: sends archive
- Save orchestration → Chunk serialization: serializes chunks
src/core/bg/downloads.js - Foreground download → Background router: sends save data
src/core/common/download.js - Background router → Save orchestration: routes downloads
src/core/bg/index.js - Save orchestration → Browser download: downloads files
src/core/bg/downloads.js - Save orchestration → Cloud destinations: uploads archives
src/core/bg/downloads.js - Save orchestration → Proof of existence: adds proof
src/core/bg/downloads.js - Save orchestration → Browser and cloud services: uses browser storage
- Toolbar and menus → Automatic saves: configures autosave
src/core/bg/autosave.js - Toolbar and menus → Batch save: starts batch save
- Background router → Profiles and options: routes settings
src/core/bg/index.js - Background router → Automatic saves: routes autosave
src/core/bg/index.js - Background router → Tab management: routes tab messages
src/core/bg/index.js - User → Archive editor: annotates archive
- Archive editor → Foreground download: downloads edited page
src/ui/content/content-ui-editor-web.js - Archive editor → MHTML conversion: converts MHTML
src/ui/content/content-ui-editor-web.js - Archive editor → Editor coordination: coordinates editor