AutoAuth, Browser Add-ons, Mozilla, Mozilla Add-ons, Mozilla Fennec, Mozilla Firefox, Slashdotter, TwitterBar, YouTube Comment Snob

Four More Fennec Add-ons

Update: TwitterBar was sold to HootSuite and renamed HootBar in March of 2011. TwitterBar for Chrome was discontinued in October of 2012.

I got some great feedback after I updated URL Fixer to be compatible with Fennec, Mozilla’s mobile browser, and I’m happy to announce that I’ve been able to add Fennec compatibility to four more add-ons:

So far, I’ve found it pretty easy to port add-ons to Fennec, with the following caveats:

  • You can’t install add-ons in Fennec by opening them from your computer; I wrote a script to copy the add-on directly into the Fennec profile, much like an add-on IV drip – straight into the bloodstream!
  • There’s no easy access to the error console , but you can open it manually if you grab the address from Firefox.
  • No DOM Inspector. For now, just browse the source.

It seems that all of these issues could be solved with a “Fennec Add-on Development” extension; maybe that will be my next project, unless easier solutions already exist.

Standard
Hawaii, Life, Mahalo

Mahalo huge in Hawaii

My wife and I spent a week on the big island of Hawaii last month, and I have to say that I was floored by how popular Mahalo is out there! As soon as we landed in Hawaii (and even on the flight from Newark), I couldn’t go more than a few minutes without overhearing someone talking about Mahalo.

Everywhere we turned, it was “Mahalo this,” “Mahalo that.” For some reason, Hawaiians just love human-powered search! (Frustratingly, I would only hear people say “Mahalo” right before the conversations ended, so I never heard exactly what they thought about the site. Nevertheless, they were usually smiling when they said it, so I took that as a good sign.)

And talk about free advertising! “Mahalo” was plastered all over the place – on welcome signs, trash cans, in bathrooms, and even on souvenir placards in gift shops:

I’m not sure why they didn’t use our actual logo (probably copyright concerns), but we should really do a case study on what propelled our site to such ubiquity in the Aloha State.

Standard
Browser Add-ons, Mozilla, Mozilla Fennec, Mozilla Firefox, URL Fixer

URL Fixer now compatible with Fennec (Mobile Firefox)

Update: URL Fixer was acquired and is now hosted at http://urlfixer.org/

Screenshot of URL Fixer being used in Fennec, the mobile Firefox browser

Fennec is the codename for Mozilla’s work-in-progress mobile browser for phones and smaller computing devices, and since it supports extensions just like Firefox, I’ve started adding Fennec compatibility to the extensions I’ve written (when it makes sense).

URL Fixer version 1.5 is fully Fennec-compatible. I think it’s even more useful in Fennec than in Firefox, given the ease with which one can fat-finger a touch-screen or mini-qwerty keyboard versus on a full-size computer keyboard.

(The screenshot above is from Fennec running on Mac OSX, so your visual results may vary depending on your device.)

Standard
Mahalo, Programming

Sprites and the new Mahalo homepage

On Friday, we at Mahalo launched a revamped homepage and site-wide redesign, the result of months of technical and editorial development. I’d like to talk specifically about one new technical aspect of the homepage.


The old Mahalo homepage had, at any given moment, between 8 and 10 content images. (By “content images,” I’m referring to images that are not design elements, like backgrounds or logos.)

Screenshot of old Mahalo homepage

The new Mahalo homepage, which packs much more data into the same space, has at any given moment, between 75 and 80 content images. (This isn’t obvious from a screenshot due to the number of tabbed sections; for example, in the top left section, each of the five tabs contains 10 items, each of which usually contains an image.)

Screenshot of the new Mahalo homepage

Displaying each of these images requires a separate request to the server, and according to some, each request can add about 0.2 seconds to the load time of the entire page; for 80 images, that’s 16 seconds of extra load time – unacceptable. Mahalo’s architecture is faster than the average site’s, but the general principle still holds true: more requests means longer load time and more stress on the servers.

To solve this problem, I was given the following tasks:

  1. Reduce the number of requests made for images when a user views the Mahalo homepage.
  2. Do so without affecting the productivity of the Guides, who upload the images and write the content for the homepage.

The solution for #1 is fairly obvious and is in widespread usage: CSS sprites. Using sprites means that all of the images for a given page are combined into a single image file, and then the browser displays sections of the master image in different parts of the page using CSS. If you dig around in the source of Mahalo’s index.html, you’ll see a reference to an image like this:

Several images stitched together into one image file

This image combines all of the separate images from the homepage into one, allowing the browser to download them all with a single request. Additionally, the total byte size of this single image is typically the same or smaller than the combined byte sizes of the images it contains, so it’s a win-win situation.

By setting the background-image CSS property of the images to this master image, we can then display only a section of the image by using CSS declarations like these:

#i-1 { background-position: -0px -230px; width: 149px; height: 115px; }
#i-2 { background-position: -0px -345px; width: 149px; height: 115px; }
#i-3 { background-position: -0px -460px; width: 149px; height: 115px; }
[...]

So problem #1: solved. Now, how to achieve this effect automatically, without affecting Guide productivity? Why, Python, of course!

Using a little Python and a touch of magic, we can retrieve the HTML for a given page, enumerate the images, retrieve the images, combine them into a single image, modify the HTML to strip references to the original images, generate the CSS necessary to implement sprites for the images, and save the HTML back out to the server. This allows our Guides to modify the homepage however they like, view their changes on a server that doesn’t use the sprites, and then sit back and enjoy as their changes are automatically published to the Mahalo production servers.


I don’t know of any other site of scale that is generating dynamic sprites, but the system we’ve set up has so far worked flawlessly. However, if you’re going to implement a similar system, there are a few caveats to keep in mind:

1. You need to be smart about how you stitch together your master image. Some poor planning (or none at all) can lead to a massive single image with tons of empty space, which will simply bloat the file size. Efficient use of space is key here.

2. By using sprites, any time a single image on the page changes, the user must re-download all of the other images, since they’re all contained in the same master image. Avoiding this problem might mean waiting for a certain number of images on the page to change before generating new sprites and HTML, or it might mean generating two or three master images for different sections of the page, so that master images for each section of the page can change independently of each other.

Have any of you ever implemented a similar system? What do you think of our implementation?

Standard
Browser Add-ons, Links Like This, Mozilla, Mozilla Firefox

Links Like This gets a facelift

Links Like This is a Firefox extension I wrote last year that allows you to automatically open multiple links from a webpage. I released the first version in May of 2007 but never really went back to update or improve it; that’s about to change.

During a recent conversation about Links Like This, I realized how poorly I designed the interface. For example, after right-clicking on a link and selecting “Open Links Like This…”, you used to see this confirmation dialog:

It’s a modal dialog, meaning that you can’t interact with the page until you’ve closed the dialog. The problem with this is that, oftentimes, you can’t see all of the links that have been chosen as “links like this” until the dialog is closed. This problem becomes even more severe when the dialog reads “Open these 143 links?” and you can only see two or three of the highlighted links.

With the latest update, selecting “Open Links Like This…” from the context menu yields this dialog:

It’s not modal, meaning that you can still scroll up and down the webpage when the dialog is visible, but it will stay on top of the webpage until you deal with it. Additionally, selected links are no longer marked with an ugly red border:

Now, they have a pleasant yellow background.

Much better, no? This small upgrade is the first of several I have planned for the next few weeks.

You can install this update at Mozilla Add-ons; if you find Links Like This useful, please consider writing a quick review on the right side of this page. Once a couple of users have given it positive reviews, I can ask Mozilla to make it a public add-on, which would make it available to all users, not just those logged in to Mozilla Add-ons.

Standard
Browser Add-ons, Mozilla, Mozilla Firefox, Yammer, Yammer Time

Stop! Yammer Time

Yammer is a service designed to help co-workers keep each other up-to-date on their work progress by answering the question “What are you working on?”

Yammer Time is a Firefox extension that reminds you to use Yammer. By default, every 4 hours between 9AM and 5PM on weekdays, it will pop up this obtrusive prompt:

Stop: Yammer time.

Just tell it what you’re working on (you are working, aren’t you?), and it will go away for the next 4 hours. You can change how often it asks (and on what days) in the Preferences dialog. You can also manually update Yammer by clicking on the Yammer Time toolbar button.

You can install Yammer Time from Mozilla Add-ons.

Standard
Life, Programming

What was your first program?

The first computer program I ever wrote was written in GW-BASIC. I was 8 or 9, and my dad had gotten me a book from the library that included the BASIC code for simple text-based games; after typing them into our IBM and playing around with them for a few hours, I decided to use what I had learned to write my own program, and it went something like this:

10 INPUT “WHAT IS YOUR NAME?”, N$
20 IF N$ = “CHRIS” THEN PRINT “YOU ARE COOL”
30 IF N$ = “AARON” THEN PRINT “YOU ARE DUMB”
40 END

I thought it was pretty cool; my brother Aaron probably disagreed. I recall having plans to use this program to not only tell me that I was cool, but to store all sorts of secret information that it would only print out if I ran the program, since no one else would think to type in my name. (I suppose this would also count as the first password I ever chose on a computer: my name. Way to go, 8-year-old self.)

Anyway, there’s not much more to this story, but I was wondering:

If you’re a programmer, what was the first program you wrote? What was the first thing you made a computer do that it wasn’t already programmed to do?

Standard