diff options
author | Omar Rizwan <omar.rizwan@gmail.com> | 2020-10-30 00:06:12 -0700 |
---|---|---|
committer | Omar Rizwan <omar.rizwan@gmail.com> | 2020-10-30 00:06:12 -0700 |
commit | f378df12ae5a443eb5e741545d9717e58b0c17eb (patch) | |
tree | 6ffbdc499aeed02bf4a082248377131d577cfb2e | |
parent | 140bd127dfc379955f28e3477909a65b25e0f928 (diff) |
More README improvements.
-rw-r--r-- | README.md | 87 | ||||
-rw-r--r-- | doc/inspector.png | bin | 0 -> 1021819 bytes |
2 files changed, 57 insertions, 30 deletions
@@ -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 +<img src="doc/inspector.png" width="600"> -(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: diff --git a/doc/inspector.png b/doc/inspector.png Binary files differnew file mode 100644 index 0000000..c0afa19 --- /dev/null +++ b/doc/inspector.png |