Chrome Extension for toggling Odoo debug modes (No debug, Normal debug debug=1, Debug assets debug=assets).
- No build system required (vanilla Chrome extension)
- No test framework configured
- For debugging: Load extension in Chrome via
chrome://extensions→ Enable Developer Mode → Load unpacked
- Use ES6+ features (arrow functions, template literals, destructuring)
- Function declarations preferred over expressions
- Use single quotes for strings
- Use
const/letinstead ofvar - Avoid global scope pollution
- Line length: max 80 characters
- Indentation: 2 spaces
- Add trailing commas for multi-line objects/arrays
- Functions: camelCase (
detectDebugMode,updateIcon) - Variables: camelCase (
debugMode,iconPath,nextMode) - CSS classes: kebab-case (
next-mode,spinner) - Constants: UPPER_SNAKE_CASE (if defined)
- Chrome extension APIs: use
chrome.*globals (chrome.tabs,chrome.action) - No ES6 imports/exports used (browser extension with manifest V3)
- Chrome APIs use callback pattern: always check for errors
- URL parsing: use string methods (
includes,indexOf,replace) - No try-catch blocks currently used
- Inline styles in popup.html (minimal, for popup UI only)
- Use semantic HTML elements
- CSS: inline styles preferred for popup
- Add block comments for file header and function descriptions
- Document parameters and return values for complex functions
- Comment code logic, not what's obvious
- Manifest V3 (service worker, action API)
- Permissions:
activeTabonly - Icons: 16px, 48px, 128px in
/iconsdirectory - Popup auto-closes after 2 seconds
- Branch:
mainormaster(both exist) - Commit message should describe the change clearly