Geoguessr Faster Map

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

目前為 2022-08-21 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Geoguessr Faster Map
// @namespace    geoguessr user scripts
// @version      1.0
// @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/game/") || url.startsWith("https://www.geoguessr.com/battle-royale/")|| url.startsWith("https://www.geoguessr.com/duels/")|| url.startsWith("https://www.geoguessr.com/team-duels/")|| url.startsWith("https://www.geoguessr.com/challenge/")|| url.startsWith("https://www.geoguessr.com/live-challenge/")) {
      (function () {
  "use strict";

  let int = setInterval(() => {
    let sticky_element = document.querySelector(".guess-map__control--sticky");
    let map = document.body.querySelectorAll(".guess-map");
    clearInterval(int);
    map.forEach((canvas) => {
      canvas.addEventListener("mouseleave", function (e) {
        if (
          sticky_element.matches(".guess-map__control--sticky-active") === true
        ) {
          document
            .querySelector(".guess-map")
            .classList.add("guess-map--active");
        } else {
          document
            .querySelector(".guess-map")
            .classList.remove("guess-map--active");
        }
      });
    });
    map.forEach((canvas) => {
      canvas.addEventListener("mouseover", function (e) {
        document.querySelector(".guess-map").classList.add("guess-map--active");
      });
    });
  }, 1000);
})();
  }
}, 500);