-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feat/web clipper manifest v3 update #7398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Octech2722
wants to merge
34
commits into
TriliumNext:main
Choose a base branch
from
Octech2722:feat/web-clipper-manifest-v3-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Feat/web clipper manifest v3 update #7398
Octech2722
wants to merge
34
commits into
TriliumNext:main
from
Octech2722:feat/web-clipper-manifest-v3-update
+15,689
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Complete Manifest V3 conversion for Chrome extension future compatibility - Add progressive status notifications with real-time feedback - Optimize performance with non-blocking async operations - Convert to ES module architecture with service worker - Replace browser.* APIs with chrome.* throughout - Add smart content script injection (dynamic, only when needed) - Enhance error handling with graceful degradation - Preserve all existing functionality while improving UX - Faster save operations with clean error-free console logs Breaking Changes: None - fully backward compatible Performance: Significantly improved save operation speed UX: Added real-time status updates during save operations
…pment files - Improve README.md formatting and spacing - Remove development/debugging files (MANIFEST_V3_CONVERSION.md, PULL_REQUEST.md, background-v2.js, verify-conversion.sh) - Clean up project structure as requested in PR review
- Manifest V3 configuration with proper permissions - TypeScript + esbuild build system - npm dependencies (Readability, DOMPurify, Cheerio) - Build configuration (IIFE bundling, watch mode) - Shared TypeScript type definitions Foundation for Trilium Web Clipper Manifest V3 migration.
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.
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.
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.
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.
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.
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.
Architecture Documentation: - System component overview (logging, theme, build) - Content processing pipeline details - File structure and organization - Message flow diagrams - Storage strategy (local vs sync) - MV3 constraints and solutions Migration Patterns: - 8 common MV2 → MV3 migration patterns - TypeScript examples with proper error handling - Chrome API usage examples - Best practices for each scenario Serves as reference to avoid re-explaining systems repeatedly.
Copilot Integration: - Streamlined instructions (70% shorter than original) - Task templates for common operations - Three-tier usage strategy (free/strategic/manual) - Optimized for GitHub Copilot Basic tier limits Development Resources: - Common task workflows with time estimates - Feature parity checklist with priorities - Debugging and troubleshooting guides - Testing scenarios and checklists - Code quality standards Workflow Optimization: - Efficient Copilot task budgeting - Real-world implementation examples - Performance and success metrics - Project completion roadmap Reduces repetitive context in prompts. Maximizes limited Copilot task budget.
- Extension icons (16x16, 48x48, 128x128) - Static assets for UI - Build configuration assets Required for extension manifest and Chrome Web Store.
… usage, and development guidelines
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[DRAFT] Manifest V3 Migration for Web Clipper
Status: 🚧 Work in Progress - Not ready for review
Progress: ~70% complete (core features done, cleanup pending)
What This PR Does
Migrates the Trilium Web Clipper from Manifest V2 to Manifest V3 to comply with Chrome's deprecation timeline (January 2025).
Current Status
✅ Completed
🚧 In Progress
📋 TODO Before Ready
Questions for Maintainers
Notes
Related