开发者

What does Firefox send for HTML5 GeoLocation data in its request?

If I have a computer connected to a router which has a wireless access point and the computer is connected by a cable, does Firefox use the ip address of the connection or the MAC address of the access point to send to the GeoLocation service when using HTML5 GeoLocation API?

It seems a MAC address would be more accurate for location determination.

I used FireFox to go to http://html5demos.com/geo and a network sniffer to find out what FF is sending 开发者_如何学运维for network identification but I couldn't find the relevant data. Any ideas which request has it? In the URL or form data?

Addition:

Can the answer include the actual request, as captured by network sniffer, sent by Firefox? I know Firefox sends either an ip address or MAC address but I am not seeing any kind of identification being sent out.


In this HTML5 example, your geolocation is never sent to the server, all is done client-side.

geolocation : this javascript gets your exact position, whit latitude/longitude

navigator.geolocation.getCurrentPosition(function() {console.log(arguments)}, function() {console.log(arguments)});

Firefox use google location services to locate you based on your public IP (router).

Then google maps then display a marker at your position

var map = new google.maps.Map(document.getElementById("mapcanvas"), myOptions);

var marker = new google.maps.Marker({
    position: latlng, 
    map: map, 
    title:"You are here!"
});


Firefox actually gathers MAC addresses of surrounding WIFI access points and send them to Google Location Services for them to achieve better location accuracy than GeoIP alone.

Google has been using StreetView cars to gather WIFI AP - location information for a long time.


See my answer to your other question, it sends a JSON object like this:

{"version":"1.1.0","request_address":true}

It doesn't send your MAC address. The full Geolocation API Network Protocol is documented here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜