A Chrome extension that tracks your carbon footprint while browsing in real-time, displaying emissions through an elegant macOS-style cursor tooltip.
- Real-time Carbon Tracking: Monitors clicks, keystrokes, scrolls, mouse movements, and session time
- Device-Specific Calculations: Adjusts emissions based on device type (mobile, desktop, tablet)
- Beautiful Tooltip: Translucent tooltip with blur background showing live emissions
- Smart Unit Conversion: Automatically converts from milligrams to trees killed for better context
- Session Persistence: Tracks data across browser sessions
- Idle Time Detection: Monitors background energy consumption
- Detailed Analytics: Popup interface with comprehensive emission breakdown
- Download or clone this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked" and select the extension folder
- The extension will be installed and active immediately
- In Chrome, go to
chrome://extensions/ - Enable "Developer mode"
- Click "Pack extension" and select the extension folder
- This will create a
.crxfile that can be distributed
The extension uses the following emission factors:
- Clicks: 0.5mg CO₂ per click
- Keystrokes: 0.3mg CO₂ per keystroke
- Scrolls: 0.2mg CO₂ per scroll event
- Mouse Movement: 0.001mg CO₂ per pixel traveled
- Session Time: 0.05mg CO₂ per second
- Idle Time: 0.1mg CO₂ per second
- Mobile: 0.7x (more efficient)
- Desktop: 1.0x (baseline)
- Tablet: 0.8x (moderate efficiency)
The extension converts emissions to "trees killed" using the approximation that one tree absorbs ~22kg CO₂ per year.
- Install the extension using Method 1 above
- Visit any website and start browsing normally
- Move your mouse to see the tooltip appear
- Click, type, and scroll to see emissions increase
- Click the extension icon to view detailed analytics
- Test on different devices to see device-specific calculations
- High Activity: Rapid clicking and scrolling on social media
- Low Activity: Reading a text-heavy article
- Idle Time: Leave a tab open without interaction
- Tab Switching: Switch between multiple tabs
- Form Filling: Fill out forms and search queries
sustainability-mirror/
├── manifest.json # Extension configuration
├── content.js # Main tracking logic
├── background.js # Background service worker
├── popup.html # Extension popup interface
├── popup.js # Popup functionality
├── styles.css # Tooltip and UI styling
└── README.md # This file
Edit the constants object in content.js:
this.constants = {
CLICK_EMISSION: 0.5, // Adjust click emissions
KEYSTROKE_EMISSION: 0.3, // Adjust keystroke emissions
// ... other factors
};Modify styles.css to customize the tooltip design:
.sustainability-tooltip {
width: 200px; /* Adjust size */
height: 50px;
background: rgba(0, 0, 0, 0.8); /* Change colors */
/* ... other styles */
}Add new event listeners in the attachEventListeners() method:
document.addEventListener('newEvent', () => {
this.addEmission('newEventType', emissionAmount);
this.showTooltip();
});- Chrome: Fully supported (Manifest V3)
- Edge: Supported with minor modifications
- Firefox: Requires Manifest V2 conversion
- Safari: Requires WebExtensions API adaptation
- Local Storage Only: All data is stored locally on the user's device
- No External Requests: No data is sent to external servers
- No Personal Information: Only interaction metrics are tracked
- User Control: Users can reset data at any time
- Minimal Impact: Lightweight event listeners with debouncing
- Efficient Storage: Periodic data saving to reduce I/O
- Optimized Calculations: Simple arithmetic operations
- Memory Management: Automatic cleanup of old data
Feel free to submit issues, feature requests, or pull requests. Key areas for improvement:
- More accurate emission calculations
- Additional device types and contexts
- Better visualization and animations
- Enhanced analytics and reporting
- Carrier-specific calculations
- Website-specific emission factors
This project is open source and available under the MIT License.