I love Firefox. I used it for many years, way past when most people switched to Chrome. Even though it was slower, I still loved the amazing selection of Addons, it’s open sourceness, and it helped that Adblock Plus seemed to work a lot better on it.

So when I got the opportunity recently to build a Firefox Add-on, I was excited. I had built a chrome extension before, and it had been fairly painless. Since there were so many Add-ons, I figured it must be just as easy to program Firefox Add-ons.

Well, it ended up being a lot more frustrating than you might think.

So when I first started out I thought I’d use their Add-on Builder, an awesome tool that allows you to build Add-ons straight from the browser. No setting up profiles, no setting up cfx, none of that. Awesome, great deal, let’s use it!

One of the neatest things is that they have a tool that lets you search for libraries you might need for your project by clicking the “plus” symbol next to Libraries. Alright, here goes nothing:

After some Googling, we come across this bug report:

https://bugzilla.mozilla.org/show_bug.cgi?id=923623

No one else is having this issue, and no one has answered it or responded to it, and it’s been 7 days. What is going on?

Let’s try this again

Alright, maybe they’re having some issues, and most people maybe develop by downloading the sdk.

So I install it, get cfx to run in my console (which launches your addon and provides logging of what’s going on).

The Firefox Addon that I was building for the client required geolocation, so one of the first things I did is try to find an easy Firefox addon that used geolocation. Enter this page:

So here I am, about 1 hour into development, and I can't get their showing a basic geolocation addon to work. I search and search, but finally ran across a Russian Firefox Support forum where some very talented developer figures out what to do:

Also see https://github.com/mozilla/r2d2b2g/pull/438
This is what you need.

If someone will face the decision:
Developers decided to make the interface nsIDOMGeoGeolocation unavailable for this, so consult with the 23 version of JS it can not be. Instead, you need to use the interface nsISupports.