Skip to content

itsPronay/FocusLock-Sites-Blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔒 FocusLock — Chrome Extension

FocusLock is a strict productivity Chrome extension that blocks distracting websites for a fixed duration — with no option to unlock early.

Once you lock a site, you're committed until the timer ends. No cheating.

Normal Mode Panic Mode History Settings

✨ Features

🚫 Website Blocking

  • Block any website by entering its domain
  • Or use “Use Current Tab” 🌐 to instantly block the site you're on

⏳ Time-Based Locking

Choose how long to block:

  • 2 hours
  • 4 hours
  • 6 hours
  • 8 hours
  • 12 hours
  • 24 hours
  • Custom duration (minutes / hours / days)

⚠️ Once locked, it cannot be undone manually


📂 Category Presets

Block multiple sites instantly:

  • Social Media
  • News
  • Video
  • Gaming

☢ Panic Mode

  • Blocks everything except optional whitelist
  • Perfect for deep work sessions

⏱ Live Countdown

  • Blocked page shows real-time countdown (HH : MM : SS)
  • Syncs perfectly with the actual lock duration

🔁 Attempt Counter

  • Tracks how many times you tried to open a blocked site
  • Displays on the blocked page:

    “You've tried 7 times. Stay strong.”


🔥 Streak Tracking

  • Tracks how many days you've stayed consistent using FocusLock

📜 Block History

  • See all previous blocks:
    • Sites blocked
    • Duration
    • Frequency

💾 Import / Export

  • Backup your blocked sites list as JSON
  • Restore anytime

💬 Motivational Quotes

  • Random quotes on blocked page to keep you focused

🚀 Installation

  1. Download or clone this repository
  2. Go to chrome://extensions
  3. Enable Developer Mode (top right)
  4. Click Load unpacked
  5. Select the extension folder
  6. Done — the 🔒 icon will appear in your toolbar

🛠 How It Works

  • Uses Chrome's declarativeNetRequest API to enforce blocking
  • Background script tracks navigation and stores blocked domains
  • Redirects blocked sites to a custom blocked page with countdown
  • Timer is stored in chrome.storage and synced across UI

🔐 Philosophy

FocusLock is intentionally designed to be hard to bypass.

There is:

  • ❌ No unblock button
  • ❌ No “just this once” option
  • ❌ No temporary override

You decide once — and commit.

⚠️ Limitations

  • Users could still disable the extension manually via Chrome
  • Works best when you commit to using it honestly

If you like this project:

  • Star the repo ⭐

  • Share with friends

  • Use it daily and stay focused

    image

About

A Chrome extension that blocks distracting websites for a fixed time.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors