Navigation
Home
Home
RSSGit ServerRainchan ImageboardBrowse Site on Tor
Home > Technology

Why I Like Qutebrowser

I've used Qutebrowser for quite a long time now - get it here. This is going to be a post from the perspective of a fan, rather than for something I've worked on myself, so I've given it a new section of its own. Generally, I don't like to repeat myself, or to repeat what others have already said. That's the reason why, although there are plenty of programs I love to work with, I may not talk about them in great excess because the reasons I like them are much the same as those already stated by others elsewhere.

But I feel like Qutebrowser, as a web browser, is an extremely undersold program, and although its claim to fame (Vim-like keybindings) is for good reason, there's so much more to it that I've never heard nor seen anyone speak about. As someone that has had exposure to many over many years (including more obscure ones like Waterfox, IceCat, and Pale Moon - I still have a little fondness for the latter two), I couldn't imagine using anything else at this point. So, I thought I'd do some missionary work.

Firstly: Vim-like Keybindings

This is the main focus of anyone speaking about it, so I suppose I have to speak about it too. And it is a great feature, but, as aforementioned, just not all there is to this browser.

Why would someone want to use a browser structured like Vim?

There's the obvious speed benefit involved. This is the first thing that comes to mind for anyone approaching Qutebrowser for the first time. Having your movement keys as h, j, k, and l on the home row (presuming you use a QWERTY keyboard - if you don't e.g. DVORAK, you can absolutely change these settings) leads for far faster movements when you get used to it. Of course, there's nothing to stop you using the arrow keys, but that's for plebs, right?

Then, of course, you can use J and K to move between tabs, gl and gr to move tabs, and so on. Every action you can think of making on any standard, fully-featured web browser is available here, largely on the home row. But "you can do most things from the home row" massively undersells the 'point' of Vim, and likewise, of Qutebrowser.

Bulk actions and macros

This is where the power of Vim, and of Qutebrowser, actually begins to show. Naturally there are many more keybindings on Qutebrowser, but for the sake of example, I'll use the "gl" command from earlier - this moves your current tab one tab to the left in amidst the other tabs. But it can also be run as a bulk action - say you have 5 tabs open, and your highlighted tab is at position 5. You can run "g3l" and your tab moves to position 2, and the tabs from positions 2 to 4 move up by one. These bulk actions can be applied to most actions available, where doing it multiple times would make sense. To get a feeling for the amount of power this can give you in complex actions, take a look below:

Of course, you don't need to remember all of those, so don't feel intimidated. You'll quickly and naturally find yourself able to recall those that are of use to you often. But for these complex bulk actions, perhaps there's a very complex one particular to your exact use case, that's going to be hard to remember. Like Vim, this is where inbuilt macros come in.

These can be accessed within Qutebrowser's 'command line' with :record-macro, and :run-macro. More conveniently however, by default they can be reached with q and @, much like Vim. Press q to begin a macro, press a key to bind that macro to, and then you can make whatever action you want, however long and complex it is. Hit q again to finish recording. Then, play it again with @. These functionalities make Qutebrowser more powerful and convenient than any other browser. For your extremely weird, specific command, particular to you and only you, you can easily make it happen instantly with something like @k - two key presses.

Hints and Follow

A key component to how Qutebrowser functions as an almost entirely keyboard based browser (you can use clicks, if you really want to), are 'hints', and 'follow'. The 'f' key is used to follow links - because of course, the point of hypertext is to be able to quickly follow 'links', jumping from one information source to the next. But how does it cope, if there are, for example, 200 links on the screen? Do you just type 'f157' and are expected to know what link is 157th on page?

Contrary, the way Qutebrowser handles links is fairly intelligent - this is where 'hints' come in. Rather than '157', if the page has 9 links or less, they will be found on the home row - 'asdfghjkl'. So, you can type 'f s' to go to link 's'. If there are dozens, links may be designated with a second 'digit', for example you may type 'f jk'. If there are hundreds, a third 'digit' - 'f skl'. You never leave the home row (of course, you can again, change the default keys), and the enumeration of links never gets out of hand. But, how do you know which link is which?

Hints are an essential part of Qutebrowser's GUI. Upon typing 'f', you are in 'follow hint' mode. All links appearing within the window will appear by default with a highlighted letter, or letters, beside them. As you type, in the case of multiple letters, the hints appearing on screen will be narrowed down (e.g. upon typing 'f g' only links appearing as 'g*' will still be present). It makes following links easier than doing so by the mouse. I'll show an example below, of course, bearing in mind I've slightly configured the appearance of my Qutebrowser install:

Incidentally, I've actually altered some of the quirks on my website to work well with Qutebrowser. Browsing this site on Qutebrowser is a dream, it's great.

And of course, as an aside mention, Qutebrowser has history, tab-completion, and bookmarks, like any other good browser. It also has 'quickmarks', allowing you to bind a URL to a shorter term to 'o'pen more quickly. It also has a console, inspect element, and most things you would generally like to see.

Minimalist GUI saves space on your screen and your disk

Qutebrowser's minimalist GUI takes up very little real estate on your screen, which is another bonus, especially if like mine your screen is about 11 inches in size. Upon 'o'pening a URL, loading a quickmark, so on, Qutebrowser will open a completion window, which takes up half the screen - this takes the appearance of a simple list, and can be configured to be smaller - I prefer to keep it at about a third of the screen. Essentially, everything is only as complex as it needs to be, and is generally out of the way.

This has another benefit - that Qutebrowser is far more lightweight than many other browsers (even despite being Chromium based), and has a small install size (if you forgive the dependencies on Qt4 and Python - which you probably already have installed for something else anyway). Let me show you:

~ $ pacman -Qi firefox | grep 'Installed Size'
Installed Size  : 205.47 MiB
~ $ pacman -Qi chromium | grep 'Installed Size'
Installed Size  : 201.36 MiB
~ $ pacman -Qi qutebrowser | grep 'Installed Size'
Installed Size  : 7.58 MiB

That is such a stark difference I wouldn't blame you if you didn't believe me at first. And despite its small size, if you want JavaScript, WebRTC, and whatever else supported, it's there.

Configurability

Another great point of Qutebrowser, whether you're some kind of 'ricer' or just extremely particular, is its configurability - there are almost definitely more options to configure the look, feel, and keyboard interaction with Qutebrowser than you could ever possibly need. There are a variety of places it can be set.

'ss'

Type 'ss' and you will immediately open the :set command at the prompt, and you'll be given a well thought-out and organised alphabetical list of everything you can change within Qutebrowser. Start typing, and you can narrow it down into sections and further subsections. When you've tab-completed or moved to an option, e.g. "colors.completion.fg", it will bring up a prompt to enter a new value, including listing its default value to switch back to. The best part about this is that everything changes instantaneously at runtime, and you can see the effects of your changes immediately.

qute://settings/

This includes a GUI menu in plain HTML of all of the settings listed above, to effect changes. I consider it inferior to the above method, but it's there if you want it, or just to get a feel for how huge your list of options are.

autoconfig.yml and config.py

Somewhere on your machine, Qutebrowser will have a configuration file, controlled by the GUI setting editor. This is called autoconfig.yml, and for me it can be found under .config/qutebrowser/ under my $HOME. Additionally however, you can overwrite these settings by creating a file in that directory, called 'config.py'. Importantly, make sure to run the function config.load_autoconfig() on the first line, otherwise it will not load the defaults as set in autoconfig.yml, and will just overwrite all of them.

The settings you change in the GUI are already permanent thanks to autoconfig.yml - so that isn't really the purpose of config.py. There is something it is incredibly useful for, however - scripting. The contents of config.py can be controlled by various scripts, to achieve different functionalities. And by running :config-source, you can see your changes take effect immediately.

To give some examples, I have two main scripts handling config.py for me. One sets 'browser modes'. Say for example, I want to have my browser completely locked down - proxy over Tor, no JS, no WebRTC, no nothing. I can do that immediately, by the script writing to config.py, and sourcing config.py. And the same script can go and revert all those changes again, instantly. Much less arduous than writing out dozens of lines for different settings. And for the ricers, I have another script handling colour schemes - it can read from .Xresources, and change the colours of various GUI elements to match, as just one example.

Qutebrowser also sets a variety of helpful environment variables for use in userscripts (generally found in $HOME/.local/share/qutebrowser/userscripts, and made executable), such as writing commands straight to Qutebrowser's FIFO (the completion prompt), parsing the HTML page, the current URL, the URL selected via 'hints', and so on.

Long story short - the thing I appreciate most about Qutebrowser isn't the Vim keybindings - it's scripting.

Privacy - Pros and Cons

Because Qutebrowser isn't a direct copy of one of the "big two" - Chrome and Firefox - it is lacking in a component for add-ons. It also doesn't have the graphical components necessary to display add-ons which are based on menus. For many people that use a variety of privacy enhancing add-ons, this is a downgrade, an inconvenience. Although you can implement some of the same functions via userscripts, it's going to be less convenient to do so. It's something to be aware of going into this browser. Let's talk about some of the positives again now.

Ad-blocking

You may be under the impression that without add-ons, Qutebrowser can't block ads - in fact, ad-blocking is inbuilt, regularly updated, and uses an /etc/hosts style format - which runs much quicker than a standard bloated ad-blocker. I have not once seen an ad while using this browser. Just run :adblock-update.

Selectively disabling JavaScript

JS can be handled on a host-by-host basis, thanks to config.py. If you would like to keep it off as a general default, but need it in a few select places, you can add URLs to your config.py like so:

config.set('content.javascript.enabled', True, '*://jisho.org/*')
Be sure to turn off JavaScript on my website ;3c (I have none).

Handling WebRTC

By default, WebRTC works the same as it does in any browser. If you'd rather you didn't leak your IP address over Tor or a VPN though, completely neutering it is a fairly straightforward process.

The below can be set in the GUI (via 'qt.args' and 'content.webrtc...'), or alternatively in config.py like so:

c.qt.args = ["force-webrtc-ip-handling-policy=disable_non_proxied_udp"]
c.content.webrtc_ip_handling_policy = 'disable-non-proxied-udp'

Proxying over Tor via SOCKS

I mentioned earlier I use Qutebrowser over Tor, this is also a surprisingly straightforward process, built-into the functionality of the browser. All you need to do is :set content.proxy.

Integrating hints with scripting

As I've mentioned both hints and scripting earlier, another useful thing to mention is that both can be integrated. These most famous example being 'hint links spawn mpv --ytdl {hint-url}' - this goes into 'follow hint' mode, and spawns mpv with the value of the URL you choose in follow mode (the only real way to watch videos). Likewise, you can simply use 'spawn mpv --ytdl {url}' to spawn mpv for the current page without going into follow mode. This has far more uses beyond just mpv however - you can bind your own scripts in your $PATH, with :bindings-commands, to pass URLs to your own scripts.

Perhaps you want to keep a list of certain URLs and add to it in a convenient way without copying URLs and going back and forth between a text file. Or you're on an onion mirror (as I often am), and would like to paste a link to someone not using Tor - pass it to the script, format the URL to it's clearnet mirror, and xclip output. For a great range of use cases, you can integrate following hints with your own scripts, while only using a few key presses and never leaving Qutebrowser.

And done

Another long rambling article. In short: I like Qutebrowser because it's highly configurable, and highly scriptable. Vim keybindings are just a bonus. For a better reference of information, go to the source, here. Hope you enjoyed whatever this was.

2020.09.02

Send me something interesting: nixx@firemail.cc