Max Golden
Max Golden

Reputation: 11

How to allow access to the browsers geolocation API using slimerJS?

I am trying to access a website using SlimerJS. On the website you can not proceed without allowing access to the browsers geolocation API. Its the popup that appears when to click allow.

Is there any way to allow and provide a geolocation to this website using SlimerJS?

Upvotes: 1

Views: 137

Answers (1)

Marco
Marco

Reputation: 579

It seems like you can't just tell the browser to send a specific position. But the code of your webpage under test uses the window.navigator object to get the location. So if you manage to somehow change or fake window.navigator.geolocation your problem should be solved.

Check this answer where Artjom points out on how to use casper.js to proxy the window.navigator.appName object. It should be possible to adapt that to your problem with the window.navigator.geolocation object.

Also this issue might be of your interest.

Upvotes: 0

Related Questions