Skip to content

samratde/website-timer-extension

Repository files navigation

Website Timer Extension

This repository is structured with shared code at the root and browser-specific files in subfolders.

What it does

  • Lets you configure target URLs using wildcard patterns and regex.
  • Shows a full-screen, non-dismissible timer modal when a configured site is opened.
  • Blocks access until user enters a duration and starts the timer.
  • Redirects the same tab to an extension page (timeout.html) when time expires.
  • Lets you customize the timeout message.

Pattern examples

  • Wildcard: https://example.com/*
  • Regex: regex:^https://(www\\.)?youtube\\.com/.*$

Project layout

  • Shared code (root): background.js, contentScript.js, contentStyles.css, options.*, timeout.*
  • Firefox-specific: firefox/manifest.json
  • Firefox build helper: firefox/scripts/build-firefox.sh

Load in Firefox

  1. Open Firefox and go to about:debugging.

  2. Click This Firefox.

  3. Run:

    ./firefox/scripts/build-firefox.sh
  4. Click Load Temporary Add-on....

  5. Select firefox/build/manifest.json.

  6. Open extension settings from about:addons to configure patterns and message.

Main files

  • firefox/manifest.json - Firefox extension manifest (MV2-compatible for broader Firefox support).
  • background.js - Rule matching, session/timer state, and redirect logic.
  • contentScript.js + contentStyles.css - Mandatory overlay UI injected into pages.
  • options.html + options.js + options.css - Extension configuration UI.
  • timeout.html + timeout.js + timeout.css - Post-timer redirect page.

About

Browser extension for putting timer on any website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors