Skip to content

Arya125-droid/Chrome-Extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FocusGate Chrome Extension

FocusGate is a productivity-boosting Chrome extension designed to gamify your LeetCode practice. It keeps you focused by blocking distracting websites and unlocks them only after you solve a set target of LeetCode questions.


🚀 Key Features

  • Smart LeetCode Integration: Automatically detects when you get an Accepted submission on LeetCode problems in real-time.
  • Focus Restrictor: Blocks popular distracting websites (like Instagram, Reddit, Amazon, etc.) using Chrome's declarativeNetRequest API during active focus sessions.
  • Reward Mechanism: Earn custom reward/break times. Once you complete your target questions, access to blocked websites is unlocked for your specified duration.
  • Visual Progress Tracking: Track your focus status, active target, and reward time remaining with a progress bar directly in the extension popup.
  • Blocklist Management: Manage domains you want to avoid during focus sessions.

🛠️ How to Set Up & Install

Since FocusGate is currently in development, you can load it directly into Google Chrome as an unpacked extension:

  1. Download the Extension: Clone or download this repository to your local machine.

  2. Open Chrome Extensions Page: Open Google Chrome and navigate to chrome://extensions/ by typing it in the address bar.

  3. Enable Developer Mode: In the top-right corner of the Extensions page, toggle the Developer mode switch to ON.

  4. Load the Extension:

    • Click the Load unpacked button in the top-left corner.
    • Select the folder containing this extension (the folder with the manifest.json file, e.g., tutorial.hello-world).
  5. Pin the Extension (Recommended): Click the puzzle piece icon (Extensions menu) in the Chrome toolbar next to your profile picture, find FocusGate, and click the pin icon for quick access.


📖 How to Use

1. Starting a Focus Session

  1. Click the FocusGate icon in your toolbar.
  2. In the Session tab, enter your:
    • Target Questions: The number of unique LeetCode problems you must solve to unlock your reward (e.g., 3).
    • Reward Duration: The duration in minutes you will be allowed to browse blocked websites after finishing your task (e.g., 30).
  3. Click Start Focus Session. The extension status will change to Active, and the background blocker will begin blocking access to restricted domains.

2. Solving LeetCode Problems

  1. Open any problem page on LeetCode.
  2. Submit your solution.
  3. Once the submission result is detected as Accepted, FocusGate registers it as solved and updates your session progress. (Note: The extension remembers problems solved during the session to avoid duplicate counting of the same problem).

3. Enjoying Your Reward

  • Once the progress bar reaches 100% (e.g., 3/3 solved), the status changes to Unlocked.
  • The blocklist is disabled, allowing you to access blocked sites.
  • A countdown timer in the popup will display the remaining time of your reward.
  • Automatic Re-lock: Once the countdown reaches 00:00, the extension automatically locks access to the blocklist again and starts a new focus session.

4. Customizing the Blocklist

  • Navigate to the Blocklist tab in the extension popup.
  • Type a domain (e.g., facebook.com) and click Add to include it.
  • You can remove domains from the list by clicking Delete next to them.

📂 File Structure

  • manifest.json - Configuration and permissions settings for the Chrome Extension (MV3).
  • focus.html - The popup interface layout.
  • popup.js - Script handling UI interactions, tab switching, and local storage updates for the popup.
  • background.js - Background service worker handling dynamic rulesets, alarms, and blocking logic.
  • content.js - Content script that runs on LeetCode problem pages to detect successful submissions.
  • hello_extensions.png - The logo icon for FocusGate.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 83.9%
  • HTML 16.1%