Like Unix, old-fashioned Linux has the philosophy that everything should look like a file. That paradigm works well and most of the operating system’s core features follow that pattern. However, many modern additions don’t really treat things as files or, at least, not files you can easily manipulate with the other tools. [Omar Rizwan] has a handy Chrome extension, though, that will make your browser tabs look like part of your file system. Not only is it a novel idea, but it is also surprisingly handy.
The extension feels like a bit of a proof of concept, so installation is a bit rough, but it does work and it allows you to do things that you would otherwise have to write an extension or a sophisticated program to screen scrape which is always less than desirable.
Once you have a directory with all your tabs, you can use tools like ls, find, and ordinary glob expressions to search through their titles, text, and URLs. There’s also a file-based interface to control each tab. For example, if you wanted to close all the Hackaday tabs (although, really, why would you want to do that?) you could issue either of these shell commands
rm ~/browser/tabs/by-title/*Hackaday* echo remove | tee -a ~/browser/tabs/by-title/*Hackaday*/control
It wasn’t clear what all you can send to the control file, but the source code has a link to the extension developer’s documentation and it looks like you could use most of those methods (e.g.,
You can even grab all the images from a page, pull the current title from YouTube Music, and a host of other things. There are folders for each extension, each window, and tabs organized by title, by ID, or you can find the last tab that had the focus. There’s also a way to create a new tab.
By default, the program mounts in a subdirectory of its choice. I changed the code to use a different directory, but if you do this, don’t put ~ in the name since that won’t be expanded as it would be in the shell.
Sure, you could do all of these things in a custom extension, but that’s a pretty big burden for simple tasks. You could probably do some of them with some of the user script extensions like GreaseMonkey. But bringing the power of shell scripting and Linux tools to the browser means you can do some pretty sophisticated processing without much effort.
The extension does take over a lot of your browser, so if you are security conscious, you’ll want to read the source code carefully. Right now to install it, you must compile it yourself, so there’s no doubt that the code you read matches the code your browser will use. We expect there will be an easier install one day and things like the debugging popups will hopefully eventually disappear.
What will you do with your tabs laid out in a directory? Let us know what you come up with. We wondered how this would be for testing, for example. TabFS would probably have made the tab knob an easier project, too.