- ✅ Converted all JavaScript files to TypeScript
- ✅ Organized code into logical modules:
src/content/- Content script modules (keyboard, modal, notifications, utils)src/background/- Background service workersrc/options/- Options pagesrc/shared/- Shared types, constants, and configsrc/styles/- CSS files (extracted from inline styles)
- ✅ All functions are now under 50 lines
- ✅ Removed redundant code patterns
- ✅ Added JSDoc comments to all exported functions
- ✅ Improved error handling
- ✅ Better type safety throughout
- ✅ Extracted inline styles to CSS files
- ✅ Proper event cleanup
- ✅ Debounced keyboard shortcuts
- ✅ Cached DOM queries where possible
- ✅ ESC key to close modal
- ✅ Better date/time parsing (handles both seconds and milliseconds)
- ✅ Improved accessibility (ARIA labels)
- ✅ Better keyboard navigation support
-
Install dependencies:
npm install
-
Build the extension:
npm run build
-
Note on ES Modules: Chrome extensions with Manifest V3 don't directly support ES modules in content scripts. The code compiles to ES2020 modules. If you encounter issues, you may need to add a bundler like
esbuild. SeeBUILD.mdfor details.
The following files are now deprecated (kept for reference):
content.js→ Replaced bysrc/content/modulesbackground.js→ Replaced bysrc/background/background.tsoptions.js→ Replaced bysrc/options/options.tsconfig.json→ Config is now managed insrc/shared/config.ts
You can remove these files after verifying the new build works correctly.