Geolocation support in add-ons

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.

This entry was posted in mozilla and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Ray R
    Posted November 13, 2009 at 6:46 am | 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?

3 Trackbacks

  1. [...] A new API will now allow add-on developers access Firefox’s geolocation features. (See Doug Turner’s post) [...]

  2. [...] A new API will now allow add-on developers access Firefox’s geolocation features. (See Doug Turner’s post) [...]

  3. [...] Una nueva API para los desarrolladores de extensiones, que les permitirá acceder a las características de geolocalización de Firefox (puedes leerlo en el post de Doug Turnder). [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>