Greasy Fork 还支持 简体中文。

Geoguessr Faster Map

Open and close the map on mouseover in a more reactive way.

  1. // ==UserScript==
  2. // @name Geoguessr Faster Map
  3. // @namespace geoguessr user scripts
  4. // @version 1.2
  5. // @description Open and close the map on mouseover in a more reactive way.
  6. // @author Edit from HugoBarjot / Base work from echandler
  7. // @match https://www.geoguessr.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13.  
  14.  
  15. setInterval(() => {
  16. const url = location.href;
  17. if (url.startsWith("https://www.geoguessr.com/") && (url.includes("/game/") || url.includes("/multiplayer"))) {
  18. (function () {
  19. "use strict";
  20.  
  21. let int = setInterval(() => {
  22. let sticky_element = document.querySelector('[data-qa="guess-map__control--sticky-active"]');
  23. let map = document.querySelectorAll('[data-qa="guess-map"]');
  24.  
  25. clearInterval(int);
  26. map.forEach((canvas) => {
  27. canvas.addEventListener("mouseleave", function (e) {
  28. if (
  29. sticky_element.matches(".guess-map_controlStickyActive__0Sauu") === true
  30. ) {
  31. //dont'remove class for active map on mouseleave event whent the sticky button is enabled
  32. } else {
  33. document.querySelector('[data-qa="guess-map"]').classList.remove("guess-map_active__MH5FE");
  34. }
  35. });
  36. });
  37. map.forEach((canvas) => {
  38. canvas.addEventListener("mouseover", function (e) {
  39. document.querySelector('[data-qa="guess-map"]').classList.add("guess-map_active__MH5FE");
  40. });
  41. });
  42. }, 1000);
  43. })();
  44. }
  45. }, 250);