Closed Bug 1743078 Opened 4 years ago Closed 5 months ago

geolocation doesn't support data json anymore

Categories

(Core :: DOM: Geolocation, defect)

Firefox 94
defect

Tracking

()

RESOLVED WORKSFORME

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

Has Regression Range: --- → no
Has STR: --- → yes
Component: Untriaged → DOM: Geolocation
Keywords: regression
Product: Firefox → Core
Severity: -- → S3

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?

Type: enhancement → defect
Whiteboard: dom-lws-bugdash-triage

WFM? Note that the pref may not apply until browser restart.

Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Resolution: --- → WORKSFORME

Oh also geo.provider.use_mls is a hidden pref that should be enabled to do this.

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