schickling/chromeless

Webpage.com wants to know your location

Opened this issue · 2 comments

Hi guys,
Is it possible to give my location to the webpage with chromeless when a prompt "Webpage.com wants to know your location" pops?
I can't browse the webpage if I don't share location...

generally, chrome has an emulate geolocation coordinates feature that is accessible via the developer GUI
https://developers.google.com/web/tools/chrome-devtools/device-mode/device-input-and-sensors
I am not sure however if this can be achieved programmatically.
You raise an interesting point though on how to use permission based features in headless browser it there is nobody to click allow. It would somewhat defeat the purpose if there was some simple js to ack the permission dialog.

I did some research and haven't found any legit ways to solve this issue but I managed to come to a temporary workaround.
While launching the script not in headless browser you can access the geolocation dialog just by pressing tab button and then hit enter to allow it. So that's what I did, predict when the dialog pops and hit tab + enter.