A daily limit for the websites that eat my time

Painted light bulb with the word idea and colored blank notes on a cork board

I wanted to do something very simple: limit how much of my day goes to YouTube Shorts, Instagram Reels and X, and can something make me stop when I pass my own limit?

So I built Webpage Time Limiter. It is a small userscript for Chrome and Safari. Each site gets its own daily limit. The script counts only the time you actually spend on the page, and it pushes back harder the longer you stay past the limit. It needs no account and no extension store, and it sends nothing to a server.

What it does

  • A daily limit for each site. It starts with three: YouTube Shorts and Instagram Reels at 15 minutes, X at 30 minutes. You can add any other site.
  • A small badge at the bottom right of a tracked page shows the time used and the limit, for example YouTube Shorts · 0:00 / 15:00.
  • Nudges that grow when you go past the limit, from a red badge to a gray page with paused videos.
  • A menu on the badge: today’s time and limit for each site with a 7-day trend, a reset for the current site, and a deliberate “grant 10 more minutes here”.
  • The day starts at 04:00, not at midnight, so you cannot wait out the counter at 23:58.
  • An optional settings app to add, edit and remove sites.

Only attention counts

One second counts only when four things are true: the tab is visible, the browser window has the focus, you used the mouse or the keyboard in the last 60 seconds, and the page matches one of your sites. Only one tab can be visible and focused at a time, so two tracked tabs never count twice. A closed laptop adds nothing either, because the clock uses real timestamps and ignores long jumps.

The first version had a gap. When I watched a video in full screen, the counter stopped after one minute. Watching is passive: no mouse, no keyboard, so the script decided that I had left. Now a playing video counts as activity, but only in the visible and focused tab.

A speed bump, not a wall

Anyone can switch off a userscript in two clicks, so the tool does not pretend to be a lock. It makes “one more video” a decision. Each site climbs its own ladder:

Time used vs. limitWhat you see
Below 50%A dimmed badge
50% or moreThe badge at full opacity
100% or moreA red badge and a full-screen overlay. You can dismiss it at once
125% or moreThe overlay again, and Dismiss waits 5 seconds
150% or moreThe page turns gray and every video pauses

Dismiss hides the overlay for 5 minutes, on that site only. Going over the limit on X does not change anything on YouTube.

Private by design

The counters stay in your browser, in the userscript storage, with 14 days of history per site. The script talks only to your own machine, where the optional settings app shares your site list. When the app is closed, the script uses the last list it read. Nothing goes to a server.

One core, two browsers

I use Safari, so a Chrome-only tool was not enough. Both builds share one core file. Only a thin adapter is different for each browser. Chrome runs it with Tampermonkey, and Safari runs it with the free Userscripts app. No Xcode, no code signing and no extension store.

What I learned

  • Measure attention, not open time. A visible tab, a focused window and recent input together are a good sign that a person is really there.
  • Watching is passive. A tracker that only listens to the mouse and the keyboard stops at the most common moment: a video.
  • Be harsher as time progresses. A wall that two clicks remove protects nothing. A nudge that grows makes me actively understand the time spent and choose to stop.

More information

You can follow the installation guide for Chrome and Safari in: Webpage Time Limiter

Code: GitHub

Picture of Nelson Eiró

Nelson Eiró

Senior Data Engineer

LinkedIn

Add comment: