Jan 7, 2010
Sometime about six months ago, I stopped using Firefox as my everyday web browser and switched to Google Chrome. Why? Because it’s fast, like browsing the internet on a rocket ship. My personal productivity suite includes a lot of Google applications (Gmail, Calendar, Reader, Docs, Voice, even a little bit of Wave every now and then), and their browser is just better optimized for the kinds of scripts those apps run. I still think Firefox is the most solid web development platform available, but if I’m not working on a web project I’m using Chrome instead.
The one thing I miss most from Firefox, however, is my library of extensions. I ran a Frankenstein browser, with add-ons sticking out in odd directions and slowing the whole thing down to a snail’s pace. I was aware that these extensions, which I installed to “enhance” my browsing experience, were actually doing more harm than good, but I couldn’t bear to uninstall most of them. I considered them essential. “I can’t uninstall Forecast Fox,” I’d tell myself. “How will I keep up with the weather?!”
I didn’t switch to Chrome all at once—I installed it when it came out in the fall of 2008, just to see what the hubbub was about. I was impressed, but couldn’t convince myself to make the switch for one reason: Chrome didn’t have my precious extensions.
But it was so fast! So very fast. I started using it to check my email and news in the morning, because Firefox’s extended start-up time was frustrating in my cranky just-woke-up fog. Then I began to notice how much smoother Gmail ran in Chrome, so I started keeping it open in parallel with Firefox—Firefox for browsing, Chrome for checking my email (and soon also Twitter and Google Reader and RTM). Then one day I didn’t open Firefox at all. The next week I went into my control panel and set Chrome as my default, and I haven’t looked back (again, except when developing).
I learned to live without most of my extensions, and I’m happier for it. The interface is less crowded this way, and the whole thing continues to run as fast as the day I installed it. But there were two things that kept on bugging me…
One: I couldn’t make use of my Jayeb.me bookmarklet (which generates a Jayeb.me-shortened URL with one click) without keeping the space-consuming bookmark toolbar open at all times. Real estate is precious.
Two: in Google’s infinite wisdom, they decided that you shouldn’t be able to customize the New Tab page at all—say, for example, setting it to your homepage instead of their eight-panel speed dial page. This irked me quite a bit, because I had already built (a rebuilt) my Boxes to serve as a New Tab page, and I’d built exactly to my specifications.
So I decided to give Chrome’s extensions a try, even though they’re still in beta. After paging through their list of already-published add-ons, I didn’t find anything that would suit my needs exactly, so I decided to build my own. Why not? These two are pretty simple, and can’t take very much code. So I fired up the Google Chrome Extension Documentation and dove in.
I was pleasantly surprised with what I found. Google has chosen to use existing web languages (namely HTML, Javascript, and JSON) to write their extensions. This is Great with a capital G, for three reasons.
First, I already know how to do this stuff. So does every other person interested in writing a browser extension. I don’t have to learn a whole new language and syntax just to make a button that shortens a web address. Instead, I make a manifest file that contained some basic information about my extension in a simple JSON format, and write a barely-qualifies-as-HTML document with some Javascript to alter the window.location of the currently focused tab. Simple as pie, and it’s all code I already knew. I like learning new things, but I like applying previously-acquired knowledge even more.
Second, using JS as the primary scripting language for these extensions allows the use of Javascript libraries for more complicated add-ons. And I don’t need to tell you how much I love Javascript libraries (well, really just one…).
Third, I think this choice might help solve one of the major problems with Firefox’s extensions: memory leaks. Browser developers can spend 24 hours a day plugging holes and optimizing memory usage for their application, but as soon as they open it up for the public to attach their own scripts to, all their hard work goes out the window. All it takes is one poorly-coded extension for the speediest browser in the world to turn into the slowest. Although there’s no guarantee, I think using Javascript for these extensions is a step in the right direction. Javascript has been around for years, and the web programming community has become quite comfortable with it. Developers are less likely to write bad, leaky code in a language they’re comfortable with. And the support of Javascript libraries helps even more—the top-tier libraries have been optimized for the smallest memory footprint possible, giving developers even less of an opportunity to screw up.
I wrote my two extensions—one places a button to the right of my location bar to shorten the current URL with Jayeb.me, and the other replaces Chrome’s New Tab page with a locally-hosted version of my Boxes—without any problems at all. I haven’t published them, and I probably won’t (both were built to satisfy personal browsing needs, and I’m not sure either would appeal to anyone but myself), but the packaging and installation process couldn’t be easier.
When this finally gets out of beta, I think it’s going to be a bit of a game-changer for the other browsers that support extensions. Google’s doing some cool stuff with this, and I’m certainly excited for it.

