geolocation doesn't support data json anymore
Categories
(Core :: DOM: Geolocation, defect)
Tracking
()
People
(Reporter: leopold.freeman.0816, Unassigned)
Details
(Keywords: regression, Whiteboard: dom-lws-bugdash-triage)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
In about:config, set geo.provider.network.url to
data:application/json,{"location":{"lat":40.712776,"lng":-74.005974},"accuracy":100}
or
data:application/json,{"location":{"lat":40.712776,"lng":-74.005974,"accuracy":100}}
doesn't work anymore, no matter geo.provider.use_corelocation is true or not
I also set up a local server, and set the geo.provider.network.url to https://xxx.com/location, the server returns:
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Fri, 26 Nov 2021 07:29:54 GMT
< Content-Length: 62
{"location":{"lat":40.712776,"lng":-74.005974},"accuracy":100}
or
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Fri, 26 Nov 2021 07:52:23 GMT
< Content-Length: 62
{"location":{"lat":40.712776,"lng":-74.005974,"accuracy":100}}
doesn't work neither
Actual results:
In console, navigator.geolocation.getCurrentPosition(p=>console.log(p)) always prints my real location, not the one I specified.
Expected results:
getCurrentPosition should return the location I specified in json
Updated•4 years ago
|
Updated•4 years ago
|
Comment 1•5 months ago
|
||
Using a data URI to hard code the location is a neat idea.
It looks like the geolocation provider switched from using XHR to Fetch in bug 1637402. Maybe that changed the behavior here?
Updated•5 months ago
|
Comment 2•5 months ago
|
||
WFM? Note that the pref may not apply until browser restart.
Comment 3•5 months ago
|
||
Oh also geo.provider.use_mls is a hidden pref that should be enabled to do this.
Description
•