Thank you for your interest in contributing to the YTgify Chrome Extension! This guide will help you get started with development and ensure your contributions meet our quality standards.
- Node.js 22.x or higher
- npm 10.x or higher
- Chrome browser for testing
- Fork and clone the repository:
git clone https://github.com/[your-username]/ytgify.git
cd ytgify- Install dependencies:
npm install- Start development mode:
npm run dev- Load the extension in Chrome:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
distfolder
- Open
npm run dev- Start webpack in watch modenpm run build- Build production extensionnpm run lint- Run ESLintnpm run typecheck- Run TypeScript type checkingnpm test- Run unit testsnpm run test:coverage- Run tests with coverage reportnpm run test:watch- Run tests in watch modenpm run validate:pre-push- Run full validation suite (same as Git hooks)
On Commit (fast):
- ESLint on staged files only
On Push (comprehensive):
- Full ESLint check
- Full extension build
- TypeScript type checking
- Unit tests
- E2E tests (wizard-basic.spec.ts with 3 parallel workers)
Why Local Testing? Testing Chrome extensions that interact with YouTube videos cannot be reliably done in GitHub Actions due to:
- YouTube blocking CI server IPs
- Video playback requiring real browser environments
- Chrome extension loading issues in headless mode
- Regional content and cookie consent variations
Timing:
- Commits are instant (only lint checks)
- Pushes take ~3-5 minutes (full validation with parallel E2E testing)
To test what will run:
On commit:
npx lint-stagedOn push:
npm run validate:pre-pushWe use ESLint and TypeScript for code quality. Before submitting a PR:
- Run linting:
npm run lint - Fix linting issues:
npm run lint:fix - Check types:
npm run typecheck
All new features and bug fixes should include tests:
- Run tests:
npm test - Check coverage:
npm run test:coverage - Coverage requirement: Maintain at least 60% code coverage
Test files should be placed in tests/unit/ following the same structure as src/.
- Create a feature branch:
git checkout -b feature/your-feature-name-
Make your changes following our coding standards
-
Commit frequently - commits only run quick lint checks
-
Push validation - Git hooks ensure all tests pass before pushing to remote
-
Write meaningful commit messages:
- Use present tense ("Add feature" not "Added feature")
- Keep first line under 50 characters
- Reference issues and pull requests liberally
- Push your branch to your fork
- Create a Pull Request against the
mainbranch - Fill out the PR template completely
- Wait for CI checks to pass
All PRs must:
- ✅ Pass all CI checks (linting, tests, type checking, build)
- ✅ Maintain or improve code coverage (minimum 60%)
- ✅ Include tests for new functionality
- ✅ Update documentation if needed
- ✅ Have a clear description of changes
- ✅ Reference any related issues
src/
├── background/ # Background service worker
├── content/ # Content scripts for YouTube
├── popup/ # Extension popup UI
├── lib/ # Shared libraries and utilities
├── types/ # TypeScript type definitions
└── components/ # React components
- Chrome Manifest V3: All code must be compatible with Manifest V3
- React Components: Use functional components with hooks
- TypeScript: Use proper typing, avoid
any - Message Passing: Use typed messages for cross-component communication
- Error Handling: Always handle errors gracefully with user feedback
- Use
chrome.runtimefor message passing - Use
chrome.storagefor persistent data - Use
chrome.tabsfor tab management - Follow Chrome Extension best practices
- Search existing issues to avoid duplicates
- Try to reproduce with the latest version
- Check if it's a Chrome/YouTube update issue
Include:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Chrome version
- Console errors (if any)
- Screenshots/GIFs (if applicable)
We welcome feature suggestions! Please:
- Check existing issues/PRs first
- Describe the use case clearly
- Explain why it would benefit users
- Consider implementation complexity
For security vulnerabilities, please email directly instead of creating a public issue. Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
Feel free to:
- Open a discussion in GitHub Discussions
- Ask in existing issues
- Reach out to maintainers
Thank you for contributing! 🎉