Short answer: SeaSweep, a free Windows study app built in Flutter, reads the title of the window in front of you. If it is a browser and the title contains a study site's name, it returns early, before any blocking rule runs. That one ordering decision is what lets a student block the whole browser and still read Wikipedia.
Students ask a version of this all the time: can I block distracting websites but still use Wikipedia and Khan Academy? Here is how we answered it in code, including the parts that are not clever.
How does the app know which site is open?
It does not read URLs. Reading another program's address bar would need a browser extension or accessibility hooks. Instead, every 0.7 seconds during a study session it asks Windows for the foreground window (GetForegroundWindow), its title (GetWindowTextW) and the process behind it (QueryFullProcessImageNameW). Browsers put the page title in the window title, and that is enough.
Browsers it recognises, by process name: chrome.exe, msedge.exe, firefox.exe, brave.exe, opera.exe, vivaldi.exe, arc.exe.
What order do the checks run in?
// simplified from desktop_guard.dart if (exe == 'taskmgr.exe') return lock('Task Manager'); // protect the app itself // ... Settings > Apps and "Uninstall a program" too if (browsers.contains(exe) && studySites.any(title.contains)) return null; // allow-list wins for (final r in rules) { if (r.exe != null && exe == r.exe) return lock(r.label, closeWindow); if (r.site != null && browsers.contains(exe) && title.contains(r.site)) return lock(r.label, closeTab); } - Self-protection first. Task Manager and the uninstall pages are closed during a session.
- The allow-list second.
wikipedia,khan academy,bitesize,duckduckgoandr/studying, lower-cased and matched against the lower-cased title. - Block rules last. Programs by
.exe, websites by a word in the title.
Because step 2 runs before step 3, a user can dock the browser itself as a program (pick chrome.exe from the list of running apps). A study-site tab in front passes; any other tab in front matches the .exe rule, and the whole window gets WM_CLOSE, background study tabs included. So strict mode means "keep only study tabs in that browser". It is not per-tab precision, and it should not be sold as that.
Why those five sites?
They are the sites the app's own Sources screen opens. Sources searches the Wikipedia API and builds search links for Khan Academy, BBC Bitesize, DuckDuckGo (PDF notes) and r/studying. If the app sends you somewhere to study, it would be absurd to close that tab. The allow-list is that promise, kept in one constant.
How is a tab closed without closing the browser?
Focus the window (SetForegroundWindow), then synthesise Ctrl+W with keybd_event. A blocked program gets PostMessageW(hwnd, WM_CLOSE) instead, the same message as clicking its X. After a lock, the guard waits four seconds before it can lock again, so lock screens do not stack.
What are the honest limits?
- Title matching is fuzzy in both directions. A YouTube video whose title contains "Khan Academy" passes the allow-list. A distracting site whose title does not contain a blocked word is not caught.
- Only the foreground window is checked. Audio from a background tab keeps playing until you bring it forward.
- The allow-list is fixed. A student cannot add their school's learning site yet, so for them "dock the whole browser" is too strict. That is the most obvious next feature.
- It is not a security tool. Someone determined can get around any user-mode blocker. The goal is friction at the moment of temptation, not a lock.
Quick reference
| Check | Matches on | Action |
|---|---|---|
| Self-protection | taskmgr.exe, Settings apps, Uninstall | close window |
| Allow-list | browser + title contains a study site | do nothing |
| Docked program | .exe name | close window |
| Docked website | browser + title contains the site word | close tab (Ctrl+W) |
Try it: SeaSweep on the Microsoft Store (free, Windows, Store ID 9N3F281GJT5T).
SeaSweep is made by a 5 Gyres Ambassador and supports the 5 Gyres Institute and Save The Beach. @5gyres #5GyresAmbassador. Earlier in this series: how to block video games on PC while studying.

