Geoguessr Cheat

Press SHIFT + ALT + G and the location of your current geoguessr game will open in a new tab

  1. // ==UserScript==
  2. // @name Geoguessr Cheat
  3. // @namespace https://www.leonbrandt.com
  4. // @version 2.0.0
  5. // @description Press SHIFT + ALT + G and the location of your current geoguessr game will open in a new tab
  6. // @author Leon Brandt
  7. // @homepage https://www.leonbrandt.com
  8. // @match http*://*/*
  9. // @grant none
  10. // @run-at document-idle
  11. // ==/UserScript==
  12.  
  13. /*
  14. MAKE SURE TO RELOAD PAGE AFTER EVERY ROUND BEFORE PRESSING SHIFT + ALT + G
  15. */
  16.  
  17. function getTargetUrl() {
  18. const raw = document.querySelectorAll("#__NEXT_DATA__")[0].text;
  19. const json = JSON.parse(raw);
  20. const rounds = json.props.pageProps.game.rounds;
  21. const currentRound = rounds[rounds.length - 1];
  22.  
  23. const targetUrl = "https://google.com/maps/place/" + currentRound.lat + "," + currentRound.lng;
  24.  
  25. return targetUrl;
  26. }
  27.  
  28. (function() {
  29. 'use strict';
  30.  
  31. document.onkeydown = evt => {
  32. evt = evt || window.event;
  33. if(evt.shiftKey && evt.altKey && evt.keyCode == 71){
  34. window.open(getTargetUrl(), '_blank');
  35. }
  36. };
  37. })();