option for 'location' answer Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
Astara
Moonbather
Moonbather
Posts: 67
Joined: 2019-04-10, 05:54
Location: California, USA

option for 'location' answer

Unread post by Astara » 2021-09-21, 08:49

Instead of passing back some location based off my IP (which varies from Santa Rosa, down to Santa Maria, as far south as a bit north of Santa Barbara, Berkeley, various places around San Francisco...etc), but never in the city or zip code where I live.

For a long time, I've regarded this as mostly a good thing, but figured, they are feeding mostly buloney to make me feel like they
don't know where I am at (despite my fighting w/my ISP over my reverse IP listing listing my full personal name instead of my business name that I signed up with, and the name of the town I'm in. And they won't change it. A****. Whatever.

Anyway, I'm getting tired of places asking for my location when I'd like to give it to them and once they get it -- they are sure that I'm someplace that has no service that I want.

So when PM asks if it can give out my location, I'd like it to be 2 answers -- one, wherever random IP-location seems to place me (current algorithm), and one which can give them accuracy to my real zip-code.

Is that possible in some new version of the location api?

FWIW -- I'm on a desktop on a home, fixed-IP system, so it's not like it really should be moving around much! ;-)

Tnx!

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35476
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: option for 'location' answer

Unread post by Moonchild » 2021-09-21, 09:17

Geopositioning (the way geolocation requests are satisfied by Pale Moon) is based on the service responses from ip-api.com which tends to be fairly accurate but may jump around based on database changes. Especially if you have a fixed IP in a "business pool" this location data response may be incorrect because such pools tend to be assigned across the entire service area of the ISP.

Being able to provide a custom set of coordinates instead of making the API request should be trivial to add. See NetworkGeolocationProvider.js -- if anyone wants to offer a patch to that effect (e.g. having the desired lat, long stored in a ".override" pref) then that's certainly welcome.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
hitokage
Fanatic
Fanatic
Posts: 101
Joined: 2014-05-03, 02:19
Location: Frederick, MD

Re: option for 'location' answer

Unread post by hitokage » 2021-09-21, 11:15

There is a way to set specific GPS coordinates by changing the pref geo.wifi.uri (that's an "i" at the end, not an "L") in about:config to point to a custom JSON file.

When I want to share my actual location, I allow the location request. When I don't, I deny the request/close the location request box, and then the website in question generally uses their own guess of my location based on IP address.

I have a file called GPS.json that I've placed into C:\Users\Public. It's a plain text file that contains the following (coordinates are an example):

Code: Select all

{
"lat":38.978889,
"lon":-76.491111,
"status":"success"
}
Then I have geo.wifi.uri in about:config set to file:///C:/Users/Public/GPS.json.

At one point Firefox allowed the coordinate data to be directly in the about:config entry, but they seemed to have changed it a long time ago (at least I couldn't get it to work that way) and that was carried over to Pale Moon.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35476
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: option for 'location' answer

Unread post by Moonchild » 2021-09-21, 12:01

Right, I thought about that just now before returning to this thread but you were ahead of me. It won't require any changes to the browser :)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
RealityRipple
Astronaut
Astronaut
Posts: 647
Joined: 2018-05-17, 02:34
Location: Los Berros Canyon, California
Contact:

Re: option for 'location' answer

Unread post by RealityRipple » 2021-09-21, 15:55

Off-topic:
Wow, didn't think anyone using Pale Moon was anywhere near me. I'm in Nipomo, just a bit north of Santa Maria.

User avatar
Astara
Moonbather
Moonbather
Posts: 67
Joined: 2019-04-10, 05:54
Location: California, USA

Re: option for 'location' answer

Unread post by Astara » 2021-09-21, 16:30

RealityRipple wrote:
2021-09-21, 15:55
Off-topic:
Wow, didn't think anyone using Pale Moon was anywhere near me. I'm in Nipomo, just a bit north of Santa Maria.
Well my location used to be down there...not recently though...pretty good for a server/desktop machine. :-)

Locked