Thank you for your interest in contributing to CacheCat! This document provides guidelines and instructions for contributing.
We welcome contributions of all kinds:
- 🐛 Bug reports
- 💡 Feature suggestions
- 📝 Documentation improvements
- 🔧 Code contributions
- 🎨 UI/UX improvements
- 🧪 Testing improvements
- Code of Conduct
- Getting Started
- Development Setup
- Development Workflow
- Making Changes
- Submitting Changes
- Code Style
- Testing
- Project Structure
- Architecture
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive feedback
- Respect different viewpoints and experiences
- Node.js 20+ and npm
- Chrome/Chromium browser
- Code editor (VS Code recommended)
- Git
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/CacheCat.git
cd CacheCat- Add upstream remote:
git remote add upstream https://github.com/chinmay29hub/CacheCat.git# Install dependencies
npm install
# Build once to create dist/
npm run build- Open
chrome://extensions/ - Enable "Developer mode" (toggle in top-right)
- Click "Load unpacked"
- Select the
dist/folder - Keep this tab open - you'll reload here frequently
- Start watch mode (rebuilds on file changes):
npm run dev-
Make changes to files in
src/ -
Reload extension after each build:
- Go to
chrome://extensions/ - Click the reload icon (🔄) on the CacheCat extension card
- Or use keyboard shortcut:
Ctrl+R(Windows/Linux) orCmd+R(Mac)
- Go to
-
Test changes:
- Open a test website (e.g.,
github.com) - Click the extension icon
- Verify your changes work
- Open a test website (e.g.,
After code changes:
- Dashboard changes: Reload extension → Reload dashboard tab
- Background script changes: Reload extension → Background service worker auto-restarts
- Agent/Content script changes: Reload extension → Reload target website tab
Quick reload shortcut:
- In
chrome://extensions/, focus the extension card and pressR(or click reload icon)
- Open dashboard tab
- Right-click → "Inspect"
- Use React DevTools extension for component inspection
- Console shows React errors and logs
React DevTools:
- Install React Developer Tools extension
- Inspect component tree, props, state, and hooks
- Go to
chrome://extensions/ - Find CacheCat extension
- Click "service worker" link (opens DevTools)
- Console shows background script logs
- Note: Service worker may sleep - click "service worker" again to wake it
Common Issues:
- Service worker stopped: Click "service worker" link to restart
- Changes not reflecting: Reload extension after rebuild
- Open DevTools on the target website
- Agent script runs in page context
- Check Console for agent messages
- Look for
__CACHECAT_AGENT__in page context
Testing Agent:
// In website console
window.__CACHECAT_AGENT__; // Should exist if agent is injected- Open DevTools on the target website
- Content script logs appear in website's console
- Messages between agent and background are logged here
- Check existing issues to see if someone is already working on it
- Create an issue for significant changes to discuss the approach
- Fork and create a branch from
main:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Create component in
src/dashboard/views/ - Add route in
src/dashboard/App.jsx - Add nav item in
src/dashboard/components/Sidebar.jsx - Rebuild and test
- Edit
src/background/background.js - Rebuild (
npm run devauto-rebuilds) - Reload extension in Chrome
- Background service worker restarts automatically
- Edit Tailwind classes in components
- Or modify
src/dashboard/index.css - Rebuild and reload dashboard tab
- Check if permission needed in
manifest.json - Use API in appropriate script (background/agent/content)
- Rebuild and reload extension
- Update your fork:
git fetch upstream
git checkout main
git merge upstream/main- Run linting and formatting:
# Check for errors
npm run lint
# Auto-fix issues
npm run lint -- --fix
# Format code
npm run format- Test your changes:
- Extension loads without errors
- Dashboard opens correctly
- Can attach to a website
- Storage data loads correctly
- CRUD operations work
- Theme toggle works
- No console errors
Write clear, descriptive commit messages:
feat: Add export functionality to Local Storage view
fix: Resolve IndexedDB pagination issue
docs: Update README with new features
style: Format code with Prettier
refactor: Simplify message passing logic
test: Add tests for cookie operations
- Push your branch:
git push origin feature/your-feature-name-
Create a Pull Request on GitHub:
- Provide a clear title and description
- Reference any related issues
- Include screenshots for UI changes
- Explain what changed and why
-
Wait for review:
- Address any feedback
- Make requested changes
- Keep the PR updated with main branch
- Use ES6+ features
- Use functional components with hooks
- Follow React best practices
- Use meaningful variable and function names
- Add comments for complex logic
We use Prettier for code formatting:
npm run formatWe use ESLint for code quality:
npm run lint
npm run lint -- --fix # Auto-fix issues- Always use watch mode (
npm run dev) during development - Reload extension after each build
- Check console for errors regularly
- Test on multiple websites to catch edge cases
- Use React DevTools for component debugging
- Format code before committing (
npm run format) - Lint code before committing (
npm run lint)
After making changes, test:
- Extension loads without errors
- Dashboard opens when clicking extension icon
- Can attach to a website
- Storage data loads correctly
- CRUD operations work
- Theme toggle works
- No console errors
- Multiple dashboards work independently
- Test on websites with various storage types
- Test with empty storage
- Test with large amounts of data
- Test edge cases (special characters, very long values, etc.)
CacheCat/
├── src/
│ ├── background/ # Service worker
│ │ └── background.js # Handles routing and message passing
│ ├── content/ # Content script bridge
│ │ └── content.js # Bridge between background and agent
│ ├── agent/ # Page context script
│ │ └── agent.js # Injected into page - storage access
│ └── dashboard/ # React app
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React contexts (Theme, Attach)
│ ├── views/ # Main views (Cookies, LocalStorage, etc.)
│ ├── App.jsx # Main app component
│ └── main.jsx # Entry point
├── icons/ # Extension icons (PNG)
├── dist/ # Build output (gitignored)
├── docs/ # Documentation and demo site
│ └── demo/ # Demo site for testing
├── manifest.json # Extension manifest
├── vite.config.js # Build configuration
└── package.json # Dependencies and scripts
- Dashboard → Background:
chrome.runtime.sendMessage - Background → Agent:
chrome.tabs.sendMessage(via content script) - Agent → Content Script:
window.postMessage - Content Script → Background:
chrome.runtime.sendMessage
- Cookies: Chrome's
chrome.cookiesAPI (background script) - Local/Session Storage: Agent script (page context)
- IndexedDB: Agent script (page context)
- Cache Storage: Agent script (page context)
Each dashboard is mapped to a specific website tab:
- When extension icon is clicked, dashboard tab ID is mapped to website tab ID
- All storage operations are routed to the correct tab
- Multiple dashboards can view different websites simultaneously
- Check
dist/folder exists and has all files - Verify
manifest.jsonis indist/ - Check browser console for errors
- Ensure all required files are present
- Make sure you reloaded the extension
- For dashboard changes, reload the dashboard tab too
- Check that build completed successfully
- Verify you're editing files in
src/, notdist/
- Click "service worker" link in extensions page
- Or unload and reload the extension
- Check service worker console for errors
- Verify website has storage data
- Check agent script is injected (look in page console)
- Verify background script is running (check service worker console)
- Check for CORS or permission errors
- Run
npm run lintto check for code issues - Check terminal for build errors
- Verify all dependencies are installed (
npm install) - Clear
dist/and rebuild
- Chrome Extension Documentation
- Manifest V3 Migration Guide
- React Documentation
- Vite Documentation
- Tailwind CSS Documentation
- Open an issue on GitHub
- Check existing issues and discussions
- Review the codebase and documentation
Thank you for contributing to CacheCat! 🐱