Geolocation API

9 views
Skip to first unread message

Zach Carter

unread,
Nov 19, 2009, 12:29:52 PM11/19/09
to mozilla-labs-jetpack
Are there plans to support the Firefox 3.6 Geolocation API so that
jetpacks can access it how extensions can?

Thanks,
Zach
Message has been deleted

Joe

unread,
Nov 20, 2009, 10:02:42 AM11/20/09
to mozilla-labs-jetpack
Does this work for you?

jetpack.future.import('menu');
jetpack.menu.context.page.add(function()({
label: 'Geolocation?',
command: function(){
var win = jetpack.tabs.focused.contentWindow;
if(win.navigator.geolocation) {
win.navigator.geolocation.getCurrentPosition(function(position)
{
jetpack.notifications.show(position.coords.latitude+',
'+position.coords.longitude);
});
} else {
jetpack.notifications.show('Geolocation not supported');
}
}
}));

Aza

unread,
Nov 20, 2009, 8:39:05 PM11/20/09
to mozilla-la...@googlegroups.com
Although this is a hack and I don't recommend it:

jetpack.__parent__.navigator.geolocation

will get you what you want.

-- aza | ɐzɐ --


--

You received this message because you are subscribed to the Google Groups "mozilla-labs-jetpack" group.
To post to this group, send email to mozilla-la...@googlegroups.com.
To unsubscribe from this group, send email to mozilla-labs-jet...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mozilla-labs-jetpack?hl=.



Zachary Carter

unread,
Nov 20, 2009, 11:04:55 PM11/20/09
to mozilla-la...@googlegroups.com
On Fri, Nov 20, 2009 at 8:39 PM, Aza <aza...@gmail.com> wrote:
Although this is a hack and I don't recommend it:

jetpack.__parent__.navigator.geolocation

will get you what you want.

 
Ah, that should work for now - at least for experimentation. Thanks!



--
Zach Carter
http://zach.carter.name
Reply all
Reply to author
Forward
0 new messages