I'm a student, and my problem was never the timer. It was the Discord tab, the game launcher and the "just one" YouTube Short I opened in the middle of a session. Every blocker I tried was either paid, or one click away from being switched off.
So I built StudyNook, a free and open-source focus timer for Windows that closes distracting apps and blocks distracting websites while you study. This post is about how it works under the hood, and how I made the website blocker survive the app being killed.
Repo: https://github.com/Amorgabab/StudyNook
The pieces
StudyNook is three runtimes working together:
- An Electron app runs the timer, your tasks and notes, and an "app guard" that scans running processes and closes the ones on your list.
- A Manifest V3 extension (Chrome, Edge, Brave) blocks websites.
- A small localhost bridge connects the two.
StudyNook (Electron) ----> closes distracting programs (app guard) | 127.0.0.1:47470 (token + pairing code, this computer only) v Browser extension (MV3) --> redirects blocked sites to a calm page The localhost bridge
The app runs a tiny HTTP server on 127.0.0.1:47470. The extension polls it to learn whether a focus round is active and which sites are blocked.
A localhost server is an easy thing to get wrong, so it is strict:
- It only listens on
127.0.0.1. - It checks the
Hostheader on every request, which stops DNS-rebinding attacks from a web page. - Everything except
/pingand/pairneeds a token. You get the token by typing a short pairing code shown in the app into the extension popup, and pairing attempts are throttled.
Turning a list into blocking rules
MV3 took away blocking webRequest, so the extension builds declarativeNetRequest dynamic rules from your list. Each blocked site becomes a redirect rule to the extension's own "blocked" page. Rules can match a single path, so you can block youtube.com/shorts and keep the rest of YouTube for lectures.
"Ghost focus": when the app disappears
The obvious way around a blocker is to close the blocker. If StudyNook disappears while a focus round is running, the extension notices that the bridge stopped answering, and it keeps blocking from the last state it was told, until the time the session would have ended. A paused focus keeps sites blocked for up to 12 hours.
Iron mode, the watchdog and a sealed session
For the days when willpower is low there is Iron mode:
- You can't pause blocking or close the app until the session ends.
- Ending early needs a 60-second cool-down and a typed sentence.
- Blocking more is instant, but removing a blocked app or site waits 60 seconds first.
If the app is killed during an Iron session, a small detached watchdog relaunches it. The session state is saved three ways: a plain session.json, an encrypted and checksummed copy (Windows DPAPI through Electron's safeStorage) so it cannot be edited by hand, and a copy held by the extension. On boot the app picks the copy it can trust.
Being honest about limits
Killing every process at once defeats the watchdog, and no browser lets an app stop you from removing an extension. StudyNook is a speed bump, not a jail. For me, a speed bump is enough: the 60 seconds are usually long enough to remember why I sat down.
The rest
- Pomodoro or one free-focus block up to 10 hours
- Tasks, notes with PDF attachments, streaks, levels and a study cat that grows with your focus time
- English, Arabic (full right-to-left), French and Spanish
- No account, no network calls, everything stored as JSON on your PC
- MIT licensed, around 400 unit tests, CI on Windows
Download the installer from the latest release. If it helps you study, a star on GitHub helps other students find it. Feedback and issues are very welcome.


