From f378df12ae5a443eb5e741545d9717e58b0c17eb Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Fri, 30 Oct 2020 00:06:12 -0700 Subject: More README improvements. --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 30 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ec5fd02..dc42369 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,38 @@ # TabFS +Mount your browser tabs as a filesystem. + +## Examples of stuff you can do + +(assuming your shell is in the `fs` subdirectory) + +### List the titles of all the tabs you have open + +``` +$ cat mnt/tabs/by-id/*/title +GitHub +Extensions +TabFS/install.sh at master · osnr/TabFS +Alternative Extension Distribution Options - Google Chrome +Web Store Hosting and Updating - Google Chrome +Home / Twitter +... +``` + +### Close all Stack Overflow tabs + +``` +$ echo close | tee -a mnt/tabs/by-title/*Stack_Overflow*/control +``` + +### Save text of all tabs to a file + +(wip, FIXME) + +``` +$ cat mnt/tabs/by-id/*/text > text.txt +``` + ## Setup First, install the browser extension. @@ -18,7 +51,8 @@ Developer mode (top-right corner). Load-unpacked the `extension/` folder in this repo. -Get the extension ID. +Make a note of the extension ID. Mine is +`jimpolemfaeckpjijgapgkmolankohgj`. We'll use this later. #### Firefox @@ -40,8 +74,18 @@ $ make Now install the native messaging host into your browser, so the extension can launch and talk to the filesystem: +#### Chrome and Chromium + +Use the extension ID you copied earlier. + +``` +$ ./install.sh chrome jimpolemfaeckpjijgapgkmolankohgj +``` + +or + ``` -$ ./install.sh [chrome | chromium | firefox] +$ ./install.sh chromium jimpolemfaeckpjijgapgkmolankohgj ``` ### Ready @@ -50,42 +94,25 @@ Reload the extension in `chrome://extensions`. Now your browser tabs should be mounted in `fs/mnt`! -## Examples of stuff you can do - -(assuming your shell is in the `fs` subdirectory) - -### List the titles of all the tabs you have open - -``` -$ cat mnt/tabs/by-id/*/title -GitHub -Extensions -TabFS/install.sh at master · osnr/TabFS -Alternative Extension Distribution Options - Google Chrome -Web Store Hosting and Updating - Google Chrome -Home / Twitter -... -``` - -### Close all Stack Overflow tabs - -``` -$ echo close | tee -a mnt/tabs/by-title/*Stack_Overflow*/control -``` +Open the background page inspector (click "background page" next to +"Inspect views" in the extension's entry in the Chrome extensions +page) to see the filesystem operations stream in. -### Save text of all tabs to a file + -(wip, FIXME) +This console is also incredibly helpful for debugging anything that +goes wrong, which probably will happen. -``` -$ cat mnt/tabs/by-id/*/text > text.txt -``` +(My OS and applications are pretty chatty! They do a lot of +operations, even when I don't feel like I'm actually doing anything.) ## Design - `extension/`: Browser extension, written in JS + - [`background.js`](extension/background.js): **The most interesting file**. Defines all the + synthetic files and what browser operations they map to. - `fs/`: Native FUSE filesystem, written in C - - `tabfs.c`: Talks to FUSE, implements fs operations, talks to browser. + - [`tabfs.c`](fs/tabfs.c): Talks to FUSE, implements fs operations, talks to extension. When you, say, `cat` a file in the tab filesystem: -- cgit v1.2.3