Configuration Options:
- Trilium server URL with validation
- Authentication token (secure storage)
- Connection testing with detailed feedback
- Save format selection (HTML/Markdown/Both)
- Parent note selection (future enhancement)
- Theme preferences with live preview
Settings Persistence:
- chrome.storage.local for connection config
- chrome.storage.sync for user preferences
- Automatic validation on save
Full theme system integration.
Features:
- Quick action buttons (Selection, Page, Link, Screenshot, Image)
- Connection status indicator with real-time updates
- Theme toggle (system/light/dark) with visual feedback
- Navigation to Settings and Logs pages
- Keyboard shortcuts display
- Full theme system integration
Entry point for most user interactions.
Initializes theme on load and persists preference.
Uses centralized logging for debugging.
Content Script Features:
- Declarative injection via manifest
- Selection extraction and HTML processing
- Image discovery and base64 conversion
- Message passing to service worker
Duplicate Note Notification
- Gives a large visual notification if an exisitng note is found in Trilium
- Can be toggled on/off via settings
- On by default
Runs in page context with proper CSP compliance.
Service Worker Architecture:
- Event-driven, stateless (MV3 compatible)
- Message passing with structured error handling
- Chrome storage for state persistence
Capture Features:
- Save Selection (with image processing and base64 embedding)
- Save Page (Readability → DOMPurify → Cheerio pipeline)
- Save Link (basic URL + title)
- Save Screenshot (full page capture, cropping pending)
- Save Image (download and embed as base64)
Additional Features:
- Duplicate note detection with user choice dialog
- Context menu initialization on install
- Keyboard shortcut handlers
- Trilium API communication (create notes, search)
- Connection testing and validation
Uses centralized logging throughout.
No global state - all persistence via chrome.storage.
Features:
- ThemeManager with three modes (light/dark/system)
- CSS custom properties for semantic colors
- Persistent storage via chrome.storage.sync
- Real-time OS theme detection and updates
- Event subscription system for theme changes
Provides professional theming across all UI components.
System mode automatically follows OS preference.
Components:
- CentralizedLogger static class for log aggregation
- Logger class with source context (background/content/popup/options)
- Persistent storage in chrome.storage.local (up to 1000 entries)
- Log viewer UI with filtering, search, and export
- Survives service worker restarts
Critical for MV3 debugging where service workers terminate frequently.
Provides unified debugging across all extension contexts.