Micro-Bookmarking with MyTabs
A few weeks ago I realized that every time I boot my laptop, one of the first things I do is to open Firefox, and immediately load about 7 web sites as tabs. Some of them requiring user interaction to navigate to the desired state. I didn’t realize that this was actually a phenomenon called “micro-bookmarking”, and that I may not be the only person who has this routine.
I don’t necessarily want to bookmark these sites, and this process of opening them is somehow part of my routine, however spending this kind of time every time I want to get to this state is just silly. Part of the ritual is to go through each of the open tabs, read the most recent updates and then close the tab, repeating this whole process many times a day.
At this point you should be starting to get the jist, to automate this whole process I created a Firefox Extension called MyTabs. The UI and use case is simple, but some of the tools I built in make it potentially very powerful.
MyTabs has the MozMill Controller built in, and is automatically setup in the tabs content window scope, allowing you to write and attach scripts to each tab to be executed ‘onload’. Thus automating the need to ever manually login to your web applications again.
Example script for logging into Facebook:
1 2 3 4 5 6 7 8 9 10 11 12 13 | //Lookup the three elements I want to interact with var email = new elementslib.ID(doc, 'email'); var pass = new elementslib.ID(doc, 'pass'); var login = doc.getElementsByClassName('UILinkButton_A')[0]; //Controller expects elementslib objects var elibLogin = new elementslib.Elem(login); //Tell the controller to type the credentials tab.type(email, 'my_facebook_account@address.com'); tab.type(pass, 'my_password'); //Click the login button tab.click(elibLogin); |
This is all possible by a really slick snipped of code I found on MDC:
1 2 | var newTabBrowser = gBrowser.getBrowserForTab(gBrowser.addTab("http://www.google.com/")); newTabBrowser.addEventListener("load", function() { newTabBrowser.contentDocument.body.innerHTML = "Stuff"; }, true); |
Security/Preferences
For the sake of security I made it so that you can only attach scripts, not edit them so that you friends can’t go and view your script to get those plain text passwords. All the tab data is stored in the prefManager so that it is available across sessions. However if someone knew enough to pick apart the source, install a trusted JS Shell and manually access the prefManager you may be in trouble… so be careful about super sensitive information especially on a shared machine.
Using jQuery UI I was able to make the UI relatively attractive, intuitive and possibly skinnable in the future (if you want to do this yourself, grab the source swap out the jQuery UI theme CSS directory and boom you have yourself new look.)
Some Screenshots




The source is fully available on GitHub, and the XPI is available on Mozilla Add-ons.
Remember that I am currently on bug fix release 0.3, but please let me know if you run into any problems!
In: Firefox, JavaScript, Mozilla, Open Source, Web · Tagged with: Addons, Firefox, JavaScript, Mozilla, Mozmill, Open Source

on February 24, 2009 at 12:08 am
Permalink
This sounds interesting, and I’ll check it out.
I wanted to mention another plugin that I use every day that is similar: Morning Coffee ( https://addons.mozilla.org/en-US/firefox/addon/2677 ). It is primarily geared around viewing web-comics, but it might spark a few ideas for you.
on February 24, 2009 at 11:26 am
Permalink
This would be a great case for some personalization to learn the tab set by user behavior. Time of day and network location would likely be good predictors for multiple sets.