Geoguessr Faster Map

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

当前为 2025-05-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Geoguessr Faster Map
// @namespace    geoguessr user scripts
// @version      1.2
// @description  Open and close the map on mouseover in a more reactive way.
// @author       Edit from HugoBarjot / Base work from echandler
// @match        https://www.geoguessr.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com
// @grant        none
// @license      MIT
// ==/UserScript==



setInterval(() => {
  const url = location.href;
  if (url.startsWith("https://www.geoguessr.com/fr") && (url.includes("/game/") || url.includes("/battle-royale/") || url.includes("/duels/") || url.includes("/teams/") || url.includes("/maprunner/") || url.includes("party") || url.includes("challenge") || url.includes("quiz") )) {
      (function () {
  "use strict";

  let int = setInterval(() => {
    let sticky_element = document.querySelector('[data-qa="guess-map__control--sticky-active"]');
    let map = document.querySelectorAll('[data-qa="guess-map"]');

    clearInterval(int);
    map.forEach((canvas) => {
      canvas.addEventListener("mouseleave", function (e) {
        if (
           sticky_element.matches(".guess-map_controlStickyActive__0Sauu") === true
        ) {
            //dont'remove class for active map on mouseleave event whent the sticky button is enabled
        } else {
          document.querySelector('[data-qa="guess-map"]').classList.remove("guess-map_active__MH5FE");
        }
      });
    });
    map.forEach((canvas) => {
      canvas.addEventListener("mouseover", function (e) {
        document.querySelector('[data-qa="guess-map"]').classList.add("guess-map_active__MH5FE");
      });
    });
  }, 1000);
})();
  }
}, 250);