Skip to content

Geolocation support in add-ons

November 12, 2009

Today, I checked-in a set of changes that will allow mozilla addons the ability to acquire the location information. It is pretty simple to do:

geolocation = Cc["@mozilla.org/geolocation;1"]
.getService(Ci.nsIDOMGeoGeolocation);
geolocation.watchPosition(successCallback);

In this trivial example, the object |geolocation| is fully compatible with the W3C’s geolocation object that exists under the navigator object in web content. |successCallback| will be called when Firefox acquires your position.

The prompting of the user is left up to your application. All addons hosted on addons.mozilla.org must follow the guidelines and prompt the user.

If you have questions about what is permissible, please contact me.

From → Uncategorized

6 Comments
  1. Ray R permalink

    I just saw this blog post regarding AMO and allowing authors to host their add-ons:

    http://blog.mozilla.com/addons/2009/11/13/amo-welcomes-self-hosted-add-ons-and-html/

    Interestingly, these off-AMO-hosted add-ons will NOT be reviewed by Mozilla. What does this mean for supporting geolocation in add-ons if there is no review by Mozilla?

  2. It was dark when I woke. This is a ray of susinnhe.

Trackbacks & Pingbacks

  1. Still some new tricks in Firefox 3.6 beta 3 - Mozilla Links
  2. Firefox 3.6b3 Released « The Firefox Extension Guru’s Blog
  3. Algunos nuevos trucos para Firefox 3.6 Beta 3 « Mozilla Links en español

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.