Kan is a browser extension for nLab that does 2 simple things:
- Makes nlab articles look like textbook chapters.
- Hover over a reference to quickly check a definition
Kan supports all major modern browsers with comprehensive cross-browser compatibility:
| Browser | Support Level | Notes |
|---|---|---|
| 🟢 Chrome | Full Support | Recommended browser, all features available |
| 🟢 Firefox | Full Support | Includes Firefox-specific optimizations |
| 🟢 Edge | Full Support | Microsoft Edge (Chromium-based) |
| 🟢 Opera | Full Support | Opera (Chromium-based) |
| 🟡 Safari | Limited Support | Some features may be limited due to Safari's extension API differences |
- Automatic browser detection and API polyfills
- Cross-browser storage with fallbacks to localStorage
- Browser-specific manifest generation for optimal compatibility
- Responsive UI that adapts to different browser rendering engines
- Dark mode support across all browsers
- High DPI display support for crisp icons and fonts
The project includes separate build commands for each browser:
# Build for specific browsers
npm run chrome-build # Build for Chrome
npm run firefox-build # Build for Firefox
npm run edge-build # Build for Microsoft Edge
npm run opera-build # Build for Opera
# Build for all browsers
npm run build
# Development with live reload
npm run chrome-watch # Development mode for Chrome
npm run firefox-watch # Development mode for Firefox
npm run edge-watch # Development mode for Edge
npm run opera-watch # Development mode for OperaDownload from the appropriate browser extension store:
- Chrome: Chrome Web Store
- Firefox: Firefox Add-ons
- Edge: Microsoft Edge Add-ons
- Opera: Opera Add-ons
Note: Extension store submissions are in progress. Links will be updated once approved.
The extension uses a sophisticated cross-browser compatibility layer:
- Extension API wrapper (
src/scripts/utils/ext.js) that normalizes differences between browser APIs - Storage polyfills that provide consistent storage interface across browsers
- Browser-specific manifest generation for optimal feature support
- CSS compatibility layers for consistent visual appearance
- Automatic feature detection and graceful degradation
For developers working on browser compatibility:
- The build system automatically generates browser-specific builds
- Cross-browser testing is recommended using the watch commands
- Browser-specific configurations are in the
config/directory - Polyfills and compatibility code is in
src/scripts/utils/