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., goBack
, reload
, etc.).
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.
Well then, I guess it’s time to make bash nab me a RTX3070
Check out brotab for something that’s perhaps less experimental, too.
I’m feeling like it’s gonna be close to how MS had explorer and explorer be the same thing, web page view of files, and you could set it up in dual pane list mode and have almost a norton commander that could view web pages.
This honestly is a great idea that I’m surprised Linux did not consider supporting years ago. What I would really love is if they could add something like including all the html,javascript,etc into sub files within each tabs folder. Then I could do something like grep -r ‘stuff’ and poof I can find every tab that I’m working with that involves stuff.
Would be nice to have that level of control over bookmarks too.
This is a pretty cool idea, though somewhat seemingly similar to the way MS Explorer’s been handling pages for a long time now. Though that’s not a dig– I think it’s pretty neat and look forward to playing around with it and seeing how it can be useful. The first thing right off the top of my head I can think of, is that it seems like it would be easier to “deal with a page” under Linux than it previously has been. The way windows does it seems like a bit of a hack, having to have two components hanging around in the file system, but it’s worked reasonably well thus far. This new approach seems more refined and in keeping with the “Unix/Linux way”.
Browsers should do this natively!
Preferably as a D-Bus API, I’d rather things transition to “everything is a DBus object” rather than everything being a file.
That sounds like pipes for hipsters. Now if you were talking a dBase object so you could handle it all on dBase III under dosemu or dosbox ….
Are browser extensions so universal now that they can be pretty much expected to work in all common browsers?
That’s the first question I have when I see something about a new browser extension. “does this even run on my browser?”
I didn’t see anything in the summary above to answer it and had to read a good 2/3 of the way through the actual linked page to see that it runs on Firefox and the Chromium family.
Ok, looking again I could have found that in the table of contents of the linked page but still… I would think that detail is a major enough aspect of the project to almost be part of the title!
Thanks to nearly everyone forking webkit engine it is less of a nightmare but I totally understand your concern. Someone above mentioned Brotab which is what I used for a while. You might want to give it a try too if TabFS gives you issues.
That is my concern as well. This is something similar to what has gone before, the integration of GUI tools into operating systems. Remember that Windows before 95 was just an application. With Windows 95 (and all of the Mac OSs) the GUI became just a part of the OS, making it harder to write applications that ran in multiple OSs. Taking advantage of the user interface tools available in a browser has the similar effect of making programs that work with specific browser extensions dependent on those extensions and therefore the set of browsers that accept those extensions. But then, this is mitigated by the fact that for browsers that work in multiple OSs, you gain access to all of the OSs that a given browser runs in. So it’s kind of a reconvergence of runtime environments in that sense.