A cross-browser extension that allows you to highlight and manage text on web pages. Supports both Chrome and Firefox.
- Text Highlighting: Select and highlight text on web pages with multiple colors
- Highlight Management: Manage and review highlighted text per page
- Minimap: View highlighted positions at a glance with a minimap on the right side of the page
- Multilingual Support: Available in English, Korean, Japanese, and Chinese
- Cross-Browser Support: Works on both Chrome and Firefox
- Keyboard Shortcuts: Quick highlighting with customizable keyboard shortcuts
- Node.js 22.16.0 or higher
- npm 10.9.0 or higher
# Clone the repository
git clone https://github.com/yourusername/text-highlighter.git
cd text-highlighter
# Install dependencies
npm installThis extension supports:
- Chrome: Manifest V3 with native Chrome APIs
- Firefox: Manifest V3 with WebExtensions polyfill for cross-browser compatibility
Run E2E tests using Playwright:
# Install Playwright browsers (required before first run)
npx playwright install
# Run tests
npx playwright testRun the deployment script to copy only the required files to the dist directory for loading into Chrome:
npm run deployTo load the deployed extension in Chrome:
- Open
chrome://extensionsin Chrome browser - Enable "Developer mode" in the top right
- Click "Load unpacked extension"
- Select the generated
distdirectory
Run the Firefox-specific deployment script:
npm run deploy:firefoxTo load the deployed extension in Firefox:
- Open
about:debuggingin Firefox browser - Click "This Firefox" in the sidebar
- Click "Load Temporary Add-on"
- Select the
manifest.jsonfile from the generateddist-firefoxdirectory
For creating a production-ready extension package, you can now specify the target browser:
npm run version-deploy <version> [browser]This command will:
- Update the version in the appropriate manifest file (
manifest.jsonfor Chrome,manifest-firefox.jsonfor Firefox) - Set
DEBUG_MODEtofalsein all JavaScript files - Build the extension to the appropriate directory (
dist/for Chrome,dist-firefox/for Firefox) - Create a browser-specific zip file in the
outputs/directory
npm run version-deploy 1.2.0
# or explicitly
npm run version-deploy 1.2.0 chromeThis creates outputs/text-highlighter-1.2.0-chrome.zip ready for submission to the Chrome Web Store.
npm run version-deploy 1.2.0 firefoxThis creates outputs/text-highlighter-1.2.0-firefox.zip ready for submission to Firefox Add-ons (AMO).
Note: Each browser build uses its own manifest file and output directory, allowing you to maintain separate versions for each browser if needed.
The extension uses the WebExtensions polyfill to ensure compatibility between Chrome and Firefox:
- Chrome: Uses native
chrome.*APIs directly - Firefox: Uses
browser.*APIs via webextension-polyfill - Manifest Files: Separate manifests for browser-specific optimizations
manifest.json: Chrome-optimized (default)manifest-firefox.json: Firefox-optimized with polyfill inclusion
All major APIs are fully compatible between browsers:
- Storage API (
chrome.storage/browser.storage) - Context Menus API (
chrome.contextMenus/browser.contextMenus) - Commands API (
chrome.commands/browser.commands) - Tabs API (
chrome.tabs/browser.tabs) - Runtime API (
chrome.runtime/browser.runtime) - Internationalization API (
chrome.i18n/browser.i18n)
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.