Hey everyone! I’m trying to find a headless browser that can handle geolocation. I know PhantomJS doesn’t have this feature, which is a bummer.
Does anyone know of any alternatives that might work? I’m really curious about how apps like prey project and lockit tight manage to use geolocation.
My main interest is in client-side geolocation, specifically using WiFi positioning and triangulation. It would be super helpful if someone could point me in the right direction or share their experiences with this.
Also, I was wondering if it might be useful to have a tag for WiFi Positioning System (WiPS) on the forum. What do you all think? Is that something that would be valuable for discussions like this?
Thanks in advance for any help or suggestions!
Hey Oscar64, have u tried selenium with chromium? it’s pretty good for geolocation stuff. i used it for a project last month and it worked great. you can set custom coordinates easy. for wifi positioning, maybe check out some python libraries? theres a few that can scan networks. good luck with ur project!
I’ve been working on a similar project recently and found that Selenium with Chrome in headless mode works pretty well for geolocation tasks. You can use the ‘chrome.geoLocation’ capability to set custom coordinates. It’s been reliable in my experience.
For WiFi positioning, I ended up using a combination of the ‘node-wifi’ library and the Google Geolocation API. It takes some setup, but it’s quite accurate once you get it running. The tricky part was handling cases where WiFi signals were weak or inconsistent.
As for the WiPS tag, I think it could be useful, especially as location-based services become more prevalent. It might help attract experts in that specific area. Maybe start using it and see if others pick it up?
One word of caution though - make sure you’re complying with privacy laws when dealing with geolocation data. It’s a sensitive area and regulations can be quite strict.
I’ve had success using Puppeteer for headless browser testing with geolocation capabilities. It’s a Node library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. You can easily set geolocation data using the page.setGeolocation() method.
For WiFi positioning, you might want to look into libraries like node-wifiscanner or node-wifi. These can help gather WiFi network information, which you can then use with geolocation APIs.
Regarding the WiPS tag, it could be useful for more specific discussions, but ‘geolocation’ might be broad enough for most cases. Perhaps start using it informally and see if it gains traction.
Hope this helps point you in the right direction for your project.