A professional, lightweight, and reliable Chrome extension for web highlighting that ensures important information is never lost
- 4 Colors: Yellow, green, blue, and pink to meet different categorization needs
- Rich Text Support: Perfectly handles complex formats including cross-node, bold, italic, etc.
- Instant Feedback: Color toolbar appears immediately after text selection with smooth, natural interaction
- Auto-Restore: Automatically restores all highlights after page refresh, supports SPA dynamic content
- Unlimited Storage: Based on Chrome Storage API with no capacity limits
- Smart Retry: Automatic retry mechanism for dynamically loaded content
- Page Rules: Supports three modes: enable all, selective enable, and disable all
- URL Matching: Flexible allow/block lists for precise highlight control
- Default Color: Customizable default highlight color
- Tree View: Hierarchical display by domain β path β highlight, clear structure
- Real-time Search: Quickly locate target highlight content
- Convenient Operations: Click highlighted text to modify color or delete
-
Clone the repository
git clone https://github.com/yourusername/Lumina.git cd Lumina -
Load the extension
- Open Chrome and visit
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked"
- Select the project root directory
- Open Chrome and visit
- Select text on any webpage
- Choose a color from the toolbar that appears
- Highlight is immediately applied and automatically saved
- Change Color: Click highlighted text β Select new color
- Delete Highlight: Click highlighted text β Click delete button
- View All: Click extension icon to open management panel
- Right-click extension icon β Select "Options"
- Choose enable mode:
- All Pages: Enable highlighting on all web pages
- Selective: Control via allow/block lists
- Disable All: Turn off highlighting feature
- Set default color (optional)
Adopts safe DOM manipulation strategy to ensure stable and reliable highlighting:
1. Traverse all text nodes within the selection range
2. Use splitText() for precise text segmentation
3. Wrap highlighted parts with <span>
4. Multiple spans share the same highlightId
- β Zero DOM Pollution: Does not damage original page structure
- β Format Preservation: Completely preserves original text format (bold, italic, etc.)
- β Cross-Node Support: Seamlessly handles rich text scenarios
- β Reliable Restoration: Smart retry mechanism adapts to dynamic content
- Manifest V3: Uses the latest Chrome extension standard
- Vanilla JavaScript: No external dependencies, lightweight and efficient
- Chrome Storage API: Local persistent storage
- Jest + JSDOM: Complete unit and integration tests
Lumina/
βββ manifest.json # Extension configuration
βββ background/
β βββ background.js # Background service script
βββ content/
β βββ content.js # Content script (core logic)
β βββ content.css # Highlight styles
βββ popup/
β βββ popup.html # Management panel UI
β βββ popup.js # Management panel logic
β βββ popup.css # Management panel styles
βββ options/
β βββ options.html # Settings page
β βββ options.js # Settings logic
βββ utils/
β βββ storage.js # Storage module (Chrome Storage)
β βββ highlight.js # Highlight core algorithm
β βββ i18n.js # Internationalization module
βββ assets/icons/ # Icon resources
βββ tests/ # Test files
βββ storage.test.js # Storage module tests
βββ highlight.test.js # Highlight algorithm tests
βββ integration.test.js # Integration tests
The project includes comprehensive automated tests to ensure stability:
# Install dependencies
pnpm install
# Run tests
pnpm test
# View coverage
pnpm test:coverageTest Coverage:
- β Storage module (URL normalization, CRUD operations, page rules)
- β Highlight algorithm (create, delete, color change, overlap detection)
- β Integration flow (select text, create highlight, restore, delete)
π‘ Tip: The actual experience is even better, we recommend installing and trying it
After selecting text, a color selection toolbar appears at the selected position, supporting quick switching between 4 colors.
Click on highlighted text to pop up an action menu for quick color modification or deletion.
Click the extension icon to open a tree-view management panel with search and quick navigation support.
- All Pages (
all): Enable highlighting on all web pages - Selective (
selective): Control via allow/block lists- Block list has higher priority than allow list
- Supports URL prefix matching
- Disable All (
none): Turn off highlighting feature
You can select a default highlight color in settings: yellow, green, blue, or pink.
- Core highlighting functionality
- Rich text support
- Auto-restore mechanism
- Page rule configuration
- Tree view management
- Search functionality
- Complete test coverage
- Internationalization (i18n)
- Chrome Web Store release
- Dark theme support
- Keyboard shortcuts
Issues and Pull Requests are welcome!
MIT License
Thanks to all developers who have contributed to this project.
Lumina - Never lose important information β¨