This guide explains how to set up your development environment and build YT re:Watch extension for both Chrome and Firefox.
- Node.js 14+ - Download here
- NPM or Yarn - Package manager (comes with Node.js)
- Chrome/Firefox - For testing the extension
- Git - For cloning the repository
git clone https://github.com/EdinUser/YouTubeLocalHistory.git
cd YouTubeLocalHistorynpm installThis will install all required dependencies including:
- Jest - For unit and integration testing
- Playwright - For end-to-end testing
- ESLint - For code linting
- Babel - For JavaScript transpilation
# Build both Chrome and Firefox versions
./build.sh
# Or build specific browser
./build.sh chrome
./build.sh firefoxAfter building, the extensions will be available in the dist/ folder:
- Chrome:
dist/youtube-local-history-chrome-v{version}.zip - Firefox:
dist/youtube-local-history-firefox-v{version}.zip
To load in browser:
- Chrome: Go to
chrome://extensions/, enable "Developer mode", click "Load unpacked" and select thebuild/chromefolder - Firefox: Go to
about:debugging, click "This Firefox", then "Load Temporary Add-on" and select thebuild/firefoxfolder
npm test# Unit tests only
npm run test:unit
# Integration tests only
npm run test:integration
# Memory tests only
npm run test:memory
# End-to-end tests (requires Playwright browsers)
npm run test:e2e
# Watch mode for development
npm run test:watchnpm run test:coverageThis generates a coverage report in the coverage/ folder.
./build.shThis will:
- Clean previous builds
- Merge locale files
- Build Chrome extension (with signing if certificates are available)
- Build Firefox extension
- Create distribution packages in
dist/
# Chrome only
./build.sh chrome
# Firefox only
./build.sh firefoxAfter building, you'll find:
- Chrome:
dist/youtube-local-history-chrome-v{version}.zipand.crx(if signed) - Firefox:
dist/youtube-local-history-firefox-v{version}.zip
src/
├── _locales/ # Multi-language support files
│ ├── en/ # English translations
│ ├── de/ # German translations
│ └── ... # Other languages
├── manifest.chrome.json # Chrome extension manifest
├── manifest.firefox.json # Firefox extension manifest
├── background.js # Service worker/background script
├── content.js # Content script for YouTube pages
├── popup.html/js # Extension popup interface
├── storage.js # Local storage management
└── indexeddb-storage.js # IndexedDB wrapper for unlimited storage
- The build script doesn't include hot reloading
- After making changes, run
./build.shand reload the extension in your browser - Use the "Reload" button in
chrome://extensions/orabout:debugging
- Enable "Debug Mode" in the extension settings for detailed logging
- Check browser console for errors
- Use
chrome://extensions/orabout:debuggingfor extension management
- Build fails: Ensure Node.js 14+ and all dependencies are installed
- Extension not loading: Check manifest permissions and browser compatibility
- Tests failing: Ensure Playwright browsers are installed (
npx playwright install)
For more technical details, see Technical Documentation