|
|
Subscribe / Log in / New account

Xxxterm: Surfing like a Vim pro

Benefits for LWN subscribers

The primary benefit from subscribing to LWN is helping to keep us publishing, but, beyond that, subscribers get immediate access to all site content and access to a number of extra site features. Please sign up today!

December 14, 2011

This article was contributed by Koen Vervloesem

Modern web browsers provide more and more functionality, so it won't be a surprise that new lightweight web browsers crop up from time to time to please users who prefer a "back to the basics" approach. In April 2009, Arch Linux release engineer Dieter Plaetinck announced Uzbl, a refreshingly minimalist web browser that prides itself for following the UNIX philosophy (LWN looked at Uzbl in July 2009). In August 2010, OpenBSD developer Marco Peereboom published the initial release of xxxterm, a lightweight and secure web browser with a vi-like command-line interface for heavy keyboard users.

The name xxxterm comes from xterm but with a triple "x" as a reference to www. Xxxterm was initially developed for OpenBSD, but it was later ported to Linux, and it's available in the repositories of Debian Sid, Gentoo, Arch Linux, and FreeBSD. It uses the WebKit browser engine and its source code is published under the ISC license, which is a permissive free software license written by the Internet Systems Consortium. It's equivalent to the two-clause BSD license and is the preferred license for OpenBSD.

In a wiki page entitled "XXXTerm Rationale", Peereboom explains why he wrote xxxterm. First and foremost, he noticed that Firefox became slower and slower, and second, he was an avid Vim user and wanted the same level of keyboard control in his web browser. So he tried a bunch of Vim-like web browsers, but none of them had the right mix of features for Peereboom. So he began tinkering with WebKit and after a few hours he had a working minimal web browser which eventually became xxxterm.

At first sight, xxxterm looks like a regular web browser, although with a somewhat boring layout: at the top of the window it has an address bar with back, forward, stop, and go buttons to the left and a search bar to the right. You can use xxxterm like any browser: Ctrl-t opens a new tab, and you can use the mouse to switch between tabs, follow links, and so on. Thanks to its WebKit engine, it has no problem rendering modern web sites, including HTML video and Flash (using the Adobe Flash plugin). However, the real beauty is that xxxterm allows fully mouse-less browsing by offering its Vim-like command-line mode.

Browser commands

Before you begin with the commands, you first have to know something about focus: F6 focuses on the address bar, F7 on the search bar, "i" on the default page input and Esc removes the focus. The latter two shortcut keys are not accidentally the same as for entering input mode and command mode in Vim. In command mode, you can use search commands like "/" (search forward), "?" (search backward), "n" (next item) and "N" (previous item). "0" (zero) scrolls the page to the far left and "$" to the far right, while "gg" goes to the top of the page and "G" to the end. A Vim user will probably know by now what actions are performed by the shortcut keys "j", "k", "h", and "l" ...

[Xxxterm tabs]

If you want to use xxxterm without touching the mouse at all, just press "f", after which the browser highlights all links and prefixes them with a number. Entering a number will follow the corresponding link. Switching to another tab without the mouse is equally easy: type :ls in command mode, which lists all the tabs in a drop down menu, and type the tab number or navigate the menu with the arrow keys.

The number of available commands is quite large, and fortunately the command mode has tab completion, so you can discover a lot of these commands yourself. For a full list, have a look at the man page. There are commands for session saving, plug-ins, tabs, and so on. A convenient, and for Vim users quite natural, command is :wq, which saves all open tabs and quits the web browser. All tabs will be reopened next time you start xxxterm.

Another interesting feature is that you can execute arbitrary commands in your running xxxterm instance by running xxxterm -e <command> in your terminal. This requires the enable_socket option to be enabled in the configuration file, but after this, you are able to control your browser session from outside the browser. For instance, xxxterm -e tabnew example.com opens example.com in a new tab and xxxterm -e wq closes your running xxxterm instance. So if your terminal emulator, email reader, or RSS feed reader supports custom commands to open links in a web browser, this is how you could configure them to use xxxterm.

Security and privacy

Xxxterm is also meant to be a secure web browser, and this is visible in features like the ability to control cookies, plug-ins, and JavaScript policies on a per-website basis. For each of these security risks, the user can define whitelists of which trusted web sites are allowed to use them. For instance, you can permanently whitelist the use of cookies on your current site with the command :cookie save or permanently whitelist the use of JavaScript with the command :js save. However, by default xxxterm behaves like any other browser, so to be able to use the whitelists, you have to place "browser_mode = whitelist" at the top of the .xxxterm.conf configuration file. The man page explains the details of what you can whitelist and how.

[Xxxterm cookie jar]

The xxxterm wiki page also mentions that many web sites not only track visitors by cookies, but also by embedding links with host names that require a DNS lookup. Because many web browsers have DNS prefetch enabled by default, your browser does all these DNS lookups whether you visit these other sites or not. This is even made worse by browsers performing link prefetching: with this feature enabled, they download the pages referenced by links with the rel="prefetch" attribute on the current page. Xxxterm has DNS and link prefetching disabled by default to thwart these web tracking techniques, which may be a bit far-fetched, but xxxterm prefers to be on the safe side.

At first sight, the prospective xxxterm user will search in vain for an ad blocker, which is strange for a web browser that prides itself on security and privacy. However, this feature is intentionally missing: the developers recommend using AdSuck, a special-purpose DNS server that can blacklist addresses belonging to advertisers, thus preventing the browser from ever connecting to the advertisers' sites. AdSuck, too, was created by Peereboom. This approach actually makes sense: it makes sure that ads and other unwanted content never make it into the browser, and as a side effect the browser becomes a bit more responsive.

The focus on security is also visible in some small things. For instance, many other web browsers have been treating non-URLs in the address bar as a search string. This is quite a convenient feature, but the developers of xxxterm have intentionally disabled it by default, because otherwise accidentally pasting a password or any other private information into the address bar would send it to a search engine. Another nice thing for the privacy-conscious is that the default search engine in the search bar is Scroogle, a web site that uses Google but disguises your IP address so Google can't track your search terms.

Comparison

Compared with other minimalist web browsers, xxxterm has clearly found its own niche. With its focus on security, it's not surprising that it's quite popular in the OpenBSD community. However, it's not the only minimalist web browser. We already mentioned Uzbl, which is much more flexible than xxxterm, but requires the user to write a lot of external shell scripts. Uzbl is actually more of a personal web browser building kit. A project with a similar approach is Luakit, which the developers call a "browser from scratch", because the user creates the entire interface in a rc.lua configuration file. There's also surf, an extremely minimalist web browser from the suckless project which just displays web pages and follows links, but doesn't even support tabbed browsing. The philosophy behind it is that tabs are not meant to be a feature of the browser but of the window manager, and hence it's a natural companion of a window manager like dwm (another project under the suckless umbrella) or awesome. However, compared with Uzbl, Luakit, and surf (which are all based on WebKit), xxxterm seems to have found a sweet spot between minimalism and usability.

It takes some time to get used to xxxterm, because the interface is really minimalist: there are no menus, and the context menu only has back, forward, stop, and reload actions. Settings like the HTTP proxy or the CA file to validate SSL certificates have to be changed in the configuration file, and the user has to memorize commands for a lot of the non-browsing tasks. However, if you are a Vim user, you already have a head start for a lot of the default shortcut keys, and under the surface of this minimalist web browser lies a surprising amount of functionality. If you're a heavy keyboard user and looking for a web browser focused on security, xxxterm is definitely something to try out.


Index entries for this article
GuestArticlesVervloesem, Koen


(Log in to post comments)

Xxxterm: Surfing like a Vim pro

Posted Dec 15, 2011 10:42 UTC (Thu) by njwhite (subscriber, #51848) [Link] (9 responses)

Sounds interesting. I'd always overlooked xxxterm, due to the unfortunate association I assumed with pornography (at least in the UK "XXX" is commonly used to refer to pornography, derived I presume from "X rated").

I use surf at present (with privoxy as adblocker), which works well, but the cookie management and similar sounds worth looking into.

Xxxterm: Surfing like a Vim pro

Posted Dec 16, 2011 22:54 UTC (Fri) by giraffedata (guest, #1954) [Link] (6 responses)

(at least in the UK "XXX" is commonly used to refer to pornography, derived I presume from "X rated").

It's the typical association with "XXX" in the US as well, which is interesting because I know the reason in the US is that the Motion Picture Association of America, which provides the offensiveness ratings using by movie theaters, originally defined a rating of "X" for things not suitable for people under 17. That was usually because it contained too much sex, so for pornographers was actually a selling point and they exaggerated it to XXX.

(The MPAA eventually abandoned X because there was no need for it. Theaters that used the rating systems wouldn't show X rated films, so producers of those films had no reason to submit them for rating).

So what's the story in the UK? Is there an "X" movie rating, or did XXX just migrate from the US?

X rating

Posted Dec 16, 2011 23:04 UTC (Fri) by corbet (editor, #1) [Link] (5 responses)

My father was a film editor during one phase of his life...that gives me the standing to be pedantic here :)

The industry abandoned "X" not because there was no use for it, but because, unlike the other ratings, they had not trademarked it. So anybody could claim to have an "X-rated" movie in a way that they couldn't do with "PG" or the others. The MPAA wanted something it had a bit more control over, so they dropped "X" in favor of "NC-17", which is properly trademarked and cannot be applied to a random porn flick.

X rating

Posted Dec 17, 2011 0:22 UTC (Sat) by giraffedata (guest, #1954) [Link] (4 responses)

I can understand why the MPAA didn't originally try to maintain any control over X. It's not anything anyone would want to forge. X was the end of the scale; if the producers of Deep Throat had submitted it for rating, it would have earned an X from the MPAA. In fact, my guess is the MPAA encouraged people with films that obviously weren't suitable for under-17 to advertise them as X without even bothering the MPAA.

NC-17 wasn't a straight replacement of X because the MPAA won't give Deep Throat an NC-17. At least that's how I remember Siskel and Ebert pushing it -- it's meant to acknowledge the existence of a category between R and porn because even adults avoid porn.

X could exist today if there were any use for it, because there are films that don't qualify for NC-17. But since people prefer to say XXX or "unrated" or nothing at all in that case, there's no use for it.

X rating

Posted Dec 17, 2011 17:51 UTC (Sat) by Baylink (guest, #755) [Link] (3 responses)

There were, in fact a few movies that released with an official, MPAA-applied X rating; Henry and June and Midnight Cowboy are the two that come instantly to mind, though I think there were one or two others.

Oh: and Coming Soon was going to get an X, because the teenagers having orgasms in that movie were female, even though the PG-13 rated American Pie was substantially raunchier: it's teenagers were boys.

X rating

Posted Dec 17, 2011 19:26 UTC (Sat) by giraffedata (guest, #1954) [Link] (2 responses)

OK, my interest has been piqued and I did some research and found out I was wrong.

I found an explanation of MPAA ratings by the father of the rating system himself, Jack Valenti. Valenti says I was right that MPAA invited producers to label a movie X without involving MPAA -- it would be a waste of MPAA's time to review the movie. But he also says that NC-17 is just a renaming of X and makes it clear that MPAA would gladly award an NC-17 rating to hardcore pornography. And confirms that no one can apply the NC-17 label without MPAA explicitly rating the movie that way.

That confuses me greatly because I can't see any reason not to let producers self-apply NC-17. Is it the risk that someone would say his movie isn't suitable for children when in fact it is?

Henry And June wasn't X. It was the first NC-17 movie. Likewise, Coming Soon must have been on track to be NC-17 rather than X because it was made after X was renamed. Midnight Cowboy was rated X by MPAA, but came out when the rating system was about a year old, before the X stigma had developed. Within a few years, it would be far less likely for anyone to apply the X label to a non-porn film. (And I'm curious as to how many did).

X rating

Posted Dec 20, 2011 13:40 UTC (Tue) by mpr22 (subscriber, #60784) [Link] (1 responses)

That confuses me greatly because I can't see any reason not to let producers self-apply NC-17.

Simple: If only the MPAA can lawfully apply the NC-17 imprimatur to a film or video recording, then the MPAA has absolute control over what it means. The MPAA likes control.

X rating

Posted Dec 22, 2011 0:00 UTC (Thu) by giraffedata (guest, #1954) [Link]

That actually begs the question. I'm asking why the MPAA wants to control the application of NC-17. It suits the MPAA's purposes just fine or better if it doesn't control NC-17. (In Valenti's essay, he emphasizes that the purpose the rating system is limited to giving parents information about the suitability of movies for children).

I appreciate MPAA wanting to control in general, but there are millions of irrelevant things the MPAA could control but doesn't; there needs to be a reason.

Xxxterm: Surfing like a Vim pro

Posted Jan 1, 2012 17:03 UTC (Sun) by kreutzm (guest, #4700) [Link] (1 responses)

Hello,

could you point me to the URL of "surf"? I could not find it on freshmeat.net and would like to add it to my list if possible.

Xxxterm: Surfing like a Vim pro

Posted Jan 2, 2012 5:01 UTC (Mon) by jrn (subscriber, #64214) [Link]

Xxxterm: Surfing like a Vim pro

Posted Dec 15, 2011 12:47 UTC (Thu) by leandro (guest, #1460) [Link]

For us GNU Emacs, there is Conkeror.

Xxxterm: Surfing like a Vim pro

Posted Dec 15, 2011 17:40 UTC (Thu) by clint (subscriber, #7076) [Link]

There's also hbro.

Xxxterm: Surfing like a Vim pro

Posted Dec 15, 2011 23:34 UTC (Thu) by mathstuf (subscriber, #69389) [Link]

Interesting. I'm an uzbl contributor and user. We know that quite a few things are missing yet (certificate verification is among them, though bct has a branch[1] for support). JavaScript black/whitelist is also not supported, but likely just needs a few hooks added in. Ideally, it'd be similar to the cookie black/whitelist where you can block based on fields such as originating site, site the JS was requested for, and more. A more structured configuration file is also underway[2] (though I've not done much with it).

[1]https://github.com/bct/uzbl/tree/ssl-tofu
[2]https://github.com/bct/uzbl/tree/flex-and-bison

graphical or not?; elinks

Posted Dec 22, 2011 17:22 UTC (Thu) by rzm (guest, #116) [Link]

I do not see much information concerning the main characteristics of the interface of mentioned browsers - if they are graphical or text mode. For WWW I use mostly elinks, highly configurable text mode WWW broser with tabs and basic Java script support. AdBlock, so much needed when I use Firefox is almost irrelevant here. I use elinks now to post this comment.


Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds