A lightweight browser extension that tracks your active browsing time across different websites. Get insights into your web habits with automatic idle detection and local data storage.
You can install the extension directly from the official Opera Add-ons store:
π Download from Opera Add-ons: https://addons.opera.com/en/extensions/details/screen-time-tracker-2/
- Real-time Tracking β Monitors active time on each website with per-second precision
- Smart Idle Detection β Automatically pauses tracking when you're inactive (customizable threshold)
- 100% Local Storage β All data stays on your device using browser storage APIsβno servers, no external tracking
- Daily Statistics β View total browsing time and breakdown by website
- Customizable Settings β Adjust idle detection sensitivity to fit your workflow
- Minimal Footprint β Lightweight background service worker that runs efficiently in the background
- Activity Monitoring β The extension detects mouse movement, keyboard input, page focus, and scrolling
- Time Tracking β When active, it records 1 second per ping from each website's content script
- Idle Detection β If no activity is detected for the threshold duration (default: 60 seconds), tracking pauses
- Data Storage β All statistics are stored locally in your browser storage, organized by date
- Auto-cleanup β Old data beyond 60 days is automatically pruned to save storage space
-
Clone or download this repository:
git clone https://github.com/KerimSikalo/ScreenTimeOperaExtension.git
-
Open Opera and navigate to extensions:
- Type
opera://extensionsin the address bar or go to Menu β Extensions β Manage Extensions
- Type
-
Enable Developer Mode (toggle in the top right corner)
-
Click Load unpacked and select the project folder
-
The extension will appear in your Opera toolbarβclick it to view your screen time
The same process works for Chromium-based browsers:
- Chrome:
chrome://extensions - Edge:
edge://extensions - Brave:
brave://extensions
Click the extension icon to see:
- Total active time today displayed prominently
- List of websites ranked by time spent (top 20)
- Reset button to clear today's data
- Settings link to customize behavior
Access extension options to configure:
-
Idle Threshold β How long (in seconds) before the extension considers you inactive
- Minimum: 5 seconds
- Default: 60 seconds
- Adjust based on your browsing habits
ScreenTimeOperaExtension/
βββ manifest.json # Extension configuration
βββ background.js # Service worker (tracks and aggregates data)
βββ content_script.js # Page-level script (monitors activity)
βββ popup.html # Extension popup interface
βββ popup.js # Popup logic and data display
βββ options.html # Settings page
βββ options.js # Settings logic
βββ icons/ # Extension icons (16px, 48px, 128px)
βββ LICENSE # MIT License
βββ PRIVACY_POLICY.md # Privacy information
βββ README.md # This file
- Receives "ping" messages from active content scripts
- Aggregates time per hostname and per day
- Manages local storage with the schema:
{ daily: { "YYYY-MM-DD": { total: seconds, bySite: { hostname: seconds } } } } - Auto-prunes data older than 60 days
- Injected into every page
- Monitors user activity (mouse, keyboard, focus, scroll)
- Sends 1-second pings to the background service when active
- Gracefully handles extension context invalidation
- Displays today's statistics
- Shows top 20 websites by time
- Provides quick access to reset and settings
Your data is yours alone:
- Zero external servers or API calls
- No analytics or tracking by third parties
- Data stored exclusively in Chrome/Opera local storage
- Full source code transparency
See PRIVACY_POLICY.md for details.
The extension requests these permissions:
storageβ To save and retrieve browsing statisticstabsβ To access tab informationalarmsβ To schedule periodic data cleanupscriptingβ To inject content scripts into pagesactiveTabβ To work with the currently active tab<all_urls>β To track time on any website
All permissions are used only for local tracking and data management.
- Lightweight β Uses a service worker instead of a persistent background page
- Efficient pinging β One message per second per active tab
- Smart idle detection β Stops pinging automatically during inactivity
- Automatic cleanup β Removes old data to prevent storage bloat
- Error handling β Gracefully handles extension reloads and edge cases
Potential enhancements for future versions:
- Weekly/monthly statistics and charts
- Dark mode UI
- Customizable time goals and alerts
- Data export (CSV/JSON)
- Notifications for excessive usage
- Sync across devices (with privacy controls)
- Ensure the extension is enabled in
opera://extensions - Check if the tab has focus (extension pauses when tab is in background)
- Verify idle threshold isn't too low in Settings
- Refresh the popup (close and reopen)
- Check browser console for errors (F12 β Console)
- Verify local storage isn't disabled in browser settings
- This is rare with a service worker, but check for background tab issues
- Try resetting today's data from the popup
Found a bug or have a feature request? Please open an issue: https://github.com/KerimSikalo/ScreenTimeOperaExtension/issues
This project is licensed under the MIT Licenseβsee LICENSE for details.
Created by Kerim Ε ikalo
Disclaimer: This extension tracks time spent on websites for personal awareness only. Use responsibly and be aware of your digital habits. The creator is not responsible for how this data is used by the end user.