Code Monkey home page Code Monkey logo

Comments (5)

erikdubbelboer avatar erikdubbelboer commented on September 16, 2024

That should work, how are you testing this?

from godet.

judgedim avatar judgedim commented on September 16, 2024

example

err := setGeolocationOverride(remote, 34.052235, -118.243683, 5.0)
if err != nil {
	fmt.Println(id, "cannot set geolocation override:", err)
	return
}
remote.Evaluate(`function geoFindMe() {
 var output = document.getElementById("elemId");

 if (!navigator.geolocation){
   output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
   return;
 }

 function success(position) {
   var latitude  = position.coords.latitude;
   var longitude = position.coords.longitude;

   output.innerHTML = '<p>Latitude is ' + latitude + '° <br>Longitude is ' + longitude + '°</p>';

   var img = new Image();
   img.src = "http://maps.googleapis.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&zoom=13&size=300x300&sensor=false";

   output.appendChild(img);
 };

 function error(err) {
output.innerHTML = "Unable to retrieve your location" + err.message;
 };

 output.innerHTML = "<p>Locating…</p>";

 navigator.geolocation.getCurrentPosition(success, error);
};
geoFindMe();`)

from godet.

erikdubbelboer avatar erikdubbelboer commented on September 16, 2024

Maybe try adding a time.Sleep(time.Second) after the call to setGeolocationOverride. Just a guess.

from godet.

judgedim avatar judgedim commented on September 16, 2024

looks like found problem, I did it before

remote.NewTab(url)

from godet.

judgedim avatar judgedim commented on September 16, 2024

thanks

from godet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.