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.
2 Comments
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?
check out the developer agreement: https://wiki.mozilla.org/AMO:Legal/Current_Developer_Agreement
3 Trackbacks
[...] A new API will now allow add-on developers access Firefox’s geolocation features. (See Doug Turner’s post) [...]
[...] A new API will now allow add-on developers access Firefox’s geolocation features. (See Doug Turner’s post) [...]
[...] 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). [...]