GeoGuessr Hide Overlays

what, you want to hide either only the map or all overlays? well then, h and j are the keys to success

Fra og med 10.08.2025. Se den nyeste version.

// ==UserScript==
// @name         GeoGuessr Hide Overlays
// @namespace    https://greasyforks.org/en/users/1501889
// @version      1.312
// @description  what, you want to hide either only the map or all overlays? well then, h and j are the keys to success
// @author       Clemens
// @match        https://www.geoguessr.com/*
// @icon         https://www.google.com/s2/favicons?domain=geoguessr.com
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const findElements = (selector) => {
        return Array.from(document.querySelectorAll(selector));
    };

    document.addEventListener('keydown', (event) => {
        if (event.key === 'h' || event.key === 'j') {
            event.preventDefault();
        }

        if (event.key === 'h') {
            const mapContainer = document.querySelector('div[data-qa="guess-map"]');
            if (mapContainer) {
                mapContainer.style.display = (mapContainer.style.display === 'none') ? '' : 'none';
            }
        }

        if (event.key === 'j') {
            const overlaySelectors = [
                'div[data-qa="guess-map"]',
                '.game_status___YFni',
                '.game_controls__xgq6p',
                '.game_inGameLogos__T9d3L',
                '.panorama-compass_compassContainer__VAYam'
            ];

            const overlays = findElements(overlaySelectors.join(', '));

            if (overlays.length > 0) {
                const isHidden = overlays[0].style.display === 'none';
                overlays.forEach(overlay => {
                    overlay.style.display = isHidden ? '' : 'none';
                });
            }
        }
    });
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。