Last Comment Bug 716453 - Network location provider unconditionally appends extra data to the provider URL
: Network location provider unconditionally appends extra data to the provider URL
Status: RESOLVED WORKSFORME
:
Product: Core
Classification: Components
Component: Geolocation (show other bugs)
: unspecified
: All All
: -- normal with 3 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks: 677256
  Show dependency treegraph
 
Reported: 2012-01-08 22:03 PST by Josh Matthews [:jdm]
Modified: 2013-10-22 03:40 PDT (History)
15 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Josh Matthews [:jdm] 2012-01-08 22:03:50 PST
+++ This bug was initially created as a clone of Bug #677256 +++

Comment 13 - Ka-Hing Cheung - 2011-11-17 22:02:13 PST

The new scheme unconditionally appends "?browser=firefox&sensor=true" to the end of geo.wifi.uri, which breaks manually setting that pref to a data uri to force a particular location. In my case I don't have wifi on this computer so I want to override the IP based detection with something more accurate. Is there a workaround?
Comment 1 Josh Matthews [:jdm] 2012-01-08 22:04:51 PST
This could be a reasonable concern. Doug, should we only be appending those extra values if we're using the default provider, or should we document that any provider used must not break in the presence of those values?
Comment 2 Doug Turner (:dougt) 2012-02-28 14:21:32 PST
This provider is very specific to Google Location Service.  if you are using another provider, you want another provider service.
Comment 3 Oliver Stewart 2012-04-01 14:16:38 PDT
The geo.wifi.uri used to be a way to specify a static location for automated testing.  I could set geo.wifi.uri to a "data:" uri with a valid service result, allowing me to depend on a specific location in my Selenium tests.  Does this mean that it's now impossible to write tests of this sort with Firefox, or is there some other way to override the location now?
Comment 4 Doug Turner (:dougt) 2012-04-01 19:59:55 PDT
>  could set geo.wifi.uri to a "data:" uri with a valid service result, allowing me to depend on a specific location in my Selenium tests.

Right, that will no longer easily work since we are passing a query.

>  Does this mean that it's now impossible to write tests of this sort with Firefox

No, we have tests in the tree that test it right now:
  http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/geolocation/network_geolocation.sjs

Something like this will work too:
  https://github.com/dougt/geofake-server

> is there some other way to override the location now?

yup.  See above. ;D
Comment 5 PhoneixSegovia 2012-05-02 09:27:08 PDT
You can use Geolocater add-on.
Comment 6 JessieC 2012-09-13 11:18:23 PDT
It seems this bug is really about the inability to manually specify location rather than how the location provider URI is formed.  The manipulations of geo.wifi.uri could be done in a way that allows for manually provided location data to be pulled from data: and/or file:.  However, manually provided location data could also be pulled from a hidden geo.locationOverride preference via JSON.parse or what have you.

As it stands now, users must either share potentially very precise location data with a third party location provider (a very significant privacy issue that leads many to disable geo location), install a third party addon (a potential security and/or privacy issue), or setup their own web server to handle location queries (a challenge from the typical user point of view).  Simply adding a pref string would be far easier and user friendly.  What are we talking about here... a few to a dozen lines of code to support this?  Is there objection to this?
Comment 7 Doug Turner (:dougt) 2012-09-13 13:18:00 PDT
Hi Jessie,  No one is objecting to fixing this.  It just happens to be a very low priority.  Patches happily accepted.  I'll or jdm will review promptly.  :)
Comment 8 mjh563 2013-10-21 19:46:02 PDT
I don't think this bug is still valid, is it? Nothing currently gets appended to the geo.wifi.uri URI. 

Custom URIs (including data: URIs) should work as expected on platforms that use the network provider, provided the response is in the correct format, ie. the response format from the Google Geolocation API that's described here:

https://developers.google.com/maps/documentation/business/geolocation/#responses
Comment 9 Josh Matthews [:jdm] 2013-10-22 03:40:09 PDT
Agreed.

Note You need to log in before you can comment on or make changes to this bug.