Skip to content

MylesMCook/Where-Was-I

Repository files navigation

Where Was I - Universal Video Tracker

A Chrome/Edge extension that automatically saves and resumes video playback positions across all websites with cross-device sync.

Features

  • Universal Tracking: Works on any website with HTML5 videos
  • Cross-Device Sync: Your video progress syncs across all your devices
  • Automatic Position Tracking: Saves video playback position every 5 seconds
  • Smart Auto-Resume: Automatically resumes videos from where you left off
  • User Controls: Toggle auto-resume on/off in settings
  • Smart Platform Detection: Defers to native resume on YouTube, Netflix, etc.
  • Clean UI: Minimalist interface showing your last watched video
  • Domain Display: See which site each video is from
  • Storage Management: Automatically manages sync storage limits
  • Privacy First: All data syncs via Chrome/Edge, no external servers

Installation

From Chrome Web Store (Coming Soon)

Once approved, install directly from the Chrome Web Store.

From Source (Developer Mode)

  1. Clone or download this repository
  2. Open Chrome/Edge and navigate to chrome://extensions/ or edge://extensions/
  3. Enable Developer Mode (toggle in top-right)
  4. Click "Load unpacked" and select the extension directory
  5. The extension is now installed!

Usage

First Time Setup

After installation, the extension is ready to use immediately with these defaults:

  • Auto-resume: Enabled
  • Tracking: All websites

How It Works

  1. Watch any video on any website
  2. Your progress saves automatically every 5 seconds
  3. Leave and return - the video resumes from where you left off
  4. Works across devices - progress syncs via your Chrome/Edge account

Viewing Your Last Video

Click the extension icon to see:

  • The last video you watched
  • Which website it's from
  • Your exact progress and percentage complete
  • A "Watch Now" button to jump back in

Settings

Click the gear icon to:

  • Toggle auto-resume on/off
  • View storage usage
  • See tracking information

Technical Details

Architecture

Manifest V3 Chrome Extension with:

  • Content Script (content.js): Monitors HTML5 video elements on all pages
  • Service Worker (background.js): Manages storage cleanup and sync
  • Popup UI (popup.html, popup.js): Shows last watched video and settings

Storage Format

Videos stored in chrome.storage.sync (syncs across devices):

{
  "videoId": {
    "timestamp": 145.6,           // Playback position in seconds
    "duration": 3600,              // Total duration in seconds
    "pageUrl": "https://...",      // Full URL of the video page
    "domain": "example.com",       // Website domain
    "lastWatched": 1234567890,     // Unix timestamp
    "title": "Video Title"         // Page title
  }
}

Sync Storage Limits

  • Maximum 20 videos stored
  • 100KB total storage (Chrome sync limit)
  • Automatic cleanup when approaching limits

Smart Auto-Resume

The extension intelligently resumes videos:

  • Waits for site to resume first (1 second)
  • Skips if already at correct position
  • Skips very beginning (< 10 seconds)
  • Defers to native resume on major platforms (YouTube, Netflix, Hulu, Disney+)
  • Can be disabled in settings

Video ID Generation

Each video is identified by a composite key:

  • Page URL path
  • Video element attributes (data-video-id, id)
  • Hash of video source URL
  • Combined and sanitized for use as storage key

Events Monitored

  • loadedmetadata: Video metadata loaded, ready for resume
  • timeupdate: Playback position changed (throttled to 5s intervals)
  • pause: Video paused, save immediately
  • ended: Video finished, remove from storage
  • beforeunload: Page closing, save final position

Performance

  • Throttled saves: Maximum one save per 5 seconds per video
  • Efficient storage: Only stores essential data
  • Automatic cleanup: Prevents storage bloat
  • Minimal CPU usage: Event-driven architecture

Privacy & Security

  • All data stored in Chrome/Edge sync storage
  • Syncs across your devices via your browser account
  • No external servers or third-party services
  • No analytics or tracking
  • No permissions beyond video tracking
  • Open source - review the code yourself

Development

Project Structure

Where-Was-I/
├── manifest.json          # Extension configuration (Manifest V3)
├── content.js            # Video tracking and auto-resume logic
├── background.js         # Service worker for storage management
├── popup.html            # Extension popup UI
├── popup.js              # Popup logic and display
├── icons/                # Extension icons (16, 32, 48, 128px)
└── README.md             # This file

Required Permissions

  • storage: Save video positions to sync storage
  • tabs: Open video URLs from popup
  • alarms: Schedule periodic cleanup
  • Host permissions: <all_urls> (required to track videos on any site)

Chrome Web Store Submission

This extension is being prepared for Chrome Web Store approval with:

  • Manifest V3 compliance
  • Minimal permissions
  • Clear privacy policy
  • No external network requests
  • User control over features

Troubleshooting

Video doesn't resume

  • Check that auto-resume is enabled in settings (gear icon)
  • Videos must be watched for at least 10 seconds before saving
  • Major platforms (YouTube, Netflix) use their own resume feature

Progress not syncing across devices

  • Ensure you're signed into Chrome/Edge on both devices
  • Check that sync is enabled in browser settings
  • Storage may take a few moments to sync

Extension not working on a site

  • Check browser console (F12) for [Where Was I] messages
  • Verify the page has HTML5 <video> elements
  • Some sites may use custom video players

Storage full warning

  • Extension automatically manages storage limits
  • Keeps only the 20 most recent videos
  • Check settings to see current storage usage

Testing

  1. Visit any website with HTML5 videos
  2. Start playing a video
  3. Check browser console for [Where Was I] log messages
  4. Refresh the page and verify auto-resume works
  5. Click extension icon to view popup
  6. Check settings to toggle features

Debugging

Enable debug logging:

  1. Open DevTools (F12)
  2. Look for [Where Was I] prefixed console messages
  3. Content script logs appear in page console
  4. Service worker logs in chrome://extensions → Details → Service worker

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly across multiple sites
  5. Submit a pull request

License

MIT License - Feel free to use and modify

Changelog

Version 1.0.0

  • Universal video tracking across all websites
  • Cross-device sync via Chrome/Edge
  • Smart auto-resume with user toggle
  • Minimalist UI showing last watched video
  • Domain display and filtering
  • Automatic storage management
  • Manifest V3 compliant

Support

For issues or questions:

  • Check the console for error messages
  • Review the troubleshooting section
  • Open an issue on GitHub

Enjoy seamless video watching across the web!

About

Chrome extension for remembering where you last left off.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors