Qutebrowser Interceptors

By chimo on (updated on )

I'm using qutebrowser as my daily-driver to browse the web. In my configs, I have interceptors to redirect "(www.)reddit.com" requests to "old.reddit.com" since I find the old interface much more usable. I wanted to add something similar for youtube, but ran into some issues.

When loading a video page on youtube (ex: youtube.com/v/<video-id>), it seems that the page doesn't have a "interceptor.ResourceType.main_frame", but instead has a "interceptor.ResourceType.preload_frame". I don't really know what any of that means, and I found out by just printing the "ResouceType" for each URL being loaded. I figured I just needed to add "preload_frame" to the list of ResourceTypes not to block.

Well at that point the browser tried to redirect but I was greeted with an error message telling me the renderer had crashed. Something very similar to the issue 5737. Maybe you're not supposed to redirect on preload_frames, I'm not sure, but I don't know what my other options would be.

I then took things into a different direction. Qutebrowser supports greasemonkey scripts. I found an existing one that is very similar to what I want to do, so I gave that a shot.

To my chagrin, it didn't seem to work. After trying a bunch of things, I realized that those scripts need JavaScript enabled in the browser (duh!). I usually have JavaScript disabled, and I turn it on/off as required. I also have a list of domains where JavaScript is permitted. So what I ended up doing is permitting JavaScript on (www.)youtube.com just so that my greasemonkey kicks-in and redirects to an Invidious instance.

So anyway, what was supposed to be a quick "add a couple of domains to a list" ended up being much more time-consuming. Which is a little funny since I use mpv to watch youtube 98% of the time anyway.

Recent articles from blogs I follow

I think fedizens should be able to disable replies to some or all of their posts

Every so often, there is a bit of a debate in the fediverse about whether a person should be able to make a post to which other users cannot reply. Yes, they should My view is simple: yes, they should. It is no different to running a website and not offering…

via Neil's blog December 7, 2024

Adding Encrypted Swap and a Userspace OOM-Killer

When setting up my Ideapad, I didn't configure swap because I wanted to avoid reducing the (already unknown) lifetime of it's eMMC storage. This, however, has proven to be a mistake - the Ideapad only has 4GB of RAM and I'm quite good at accid…

via www.bentasker.co.uk December 7, 2024

Advent of Code: Day 4

Link to Day #4 puzzle.

via not just serendipity December 6, 2024