My First Extension

18 Jul 2023

Recently I’ve been making a Firefox browser extension to temporarily block myself from using certain websites. Upon loading a website listed in the blocklist, it renders a block screen over the site with some text mentioning that it’s been blocked, and a button to unpause the screen. After 15 seconds, it removes the screen and 5 minutes after that, it shows the screen again and the cycle continues. It’s easy enough to add a website to the blocklist but it takes 20 seconds to remove one AND you have to keep the popup open to let the countdown finish.

It’s been an annoying extension. But it’s also been effective. I’ve been using it for the last few weeks and on the days I’ve remembered to load it as a temporary add-on (I need to actually publish it), I’ve seen a notable lack of scrolling and hacker news browsing. My blocklist currently contains:

In browsing Hacker News, like many others, I’ve been in the habit of opening the comments for 10 posts at a time, reading them then deciding whether or not to open the actual article. With this extension, I’ve found myself opening fewer comments and reading more articles completely. Since HN (thankfully) doesn’t have infinite scroll, loading a new page means getting blocked again, which forces me to think about whether or not I actually want to keep browsing.

What I’ve found is that sometimes I’ll open Firefox and just open all of them at once. new (HN) > Enter > Cmd + T > yout (youtube) > Enter > Cmd + T > inst (instagram) > Enter > Cmd + T > old (reddit, I like the old version duh) > Enter Without even thinking. In the past, I’d easily spend hours of the day on any one of these websites after doing this. Now, most of the time, I’ll hit unpause on maybe 2 of them and close the other two. Then I’ll come back to the two that were open and with 1 or 2 seconds left I’ll just close the tabs.

It proves to be annoying if I’m trying to watch a video that’s longer than 5 minutes but at that point, I would willingly wait the 20 seconds to cancel the timer if it’s there. I haven’t completely shipped it yet; it uses vue for reactivity and watcher functions but it’s a bit much. I need to think that through a bit more. It also still shows the block screen on a page if you’ve just removed it from the blocklist. A few things to work out but it mostly works. It also doesn’t look pretty yet but that’s not a priority just yet.

I heard on a Tim Ferriss podcast that trying to use discipline to avoid using social media is like bringing a knife to a gunfight. This extension has helped me avoid the fight altogether. Or see the fight, shrug, then leave, go home and play factorio instead.