Geoguessr Hide Results

Hide results of guesses and opponents in challenges

当前为 2025-07-17 提交的版本,查看 最新版本

// ==UserScript==
// @name         Geoguessr Hide Results
// @namespace    http://tampermonkey.net/
// @author       BrainyGPT
// @version      1.0
// @description  Hide results of guesses and opponents in challenges
// @match        https://www.geoguessr.com/*
// @icon         https://i.imgur.com/IG8yPEV.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // Inject into page context to override Google Maps zoom behavior
    const script = document.createElement('script');
    script.textContent = `
        (function() {
            const waitForGoogleMaps = setInterval(() => {
                if (typeof google !== 'undefined' && google.maps && google.maps.Map) {
                    clearInterval(waitForGoogleMaps);

                    const originalFitBounds = google.maps.Map.prototype.fitBounds;
                    const originalPanTo = google.maps.Map.prototype.panTo;

                    google.maps.Map.prototype.fitBounds = function(bounds, padding) {
                        if (!window.__disableAutoFit) {
                            return originalFitBounds.call(this, bounds, padding);
                        }
                        const dummyBounds = new google.maps.LatLngBounds(
                            { lat: 0.0001, lng: 0.0001 },
                            { lat: 0.0001, lng: 0.0001 }
                        );
                        console.log('[GeoTamper] fitBounds suppressed');
                        return originalFitBounds.call(this, dummyBounds, 0);
                    };

                    google.maps.Map.prototype.panTo = function(latLng) {
                        if (!window.__disableAutoFit) {
                            return originalPanTo.call(this, latLng);
                        }
                        const nullIsland = new google.maps.LatLng(0, 0);
                        console.log('[GeoTamper] panTo suppressed');
                        return originalPanTo.call(this, nullIsland);
                    };

                    window.__disableAutoFit = true;
                    console.log('[GeoTamper] Auto-zoom disabled by default (Safe mode)');
                }
            }, 250);
        })();
    `;
    document.documentElement.appendChild(script);

    // Function to remove global elements at all times
    function removePersistentElements() {
        const selectors = [
            '.game-reactions_root__TSjX_',
            'div.status_section__RVR6u[data-qa="score"]',
            '.current-standings_container__vzyTJ',
            '.result_buttons__co3Zc',
            '.round-result_pointsIndicatorWrapper__7JxD_',
            '.round-result_distanceIndicatorWrapper__qNO6y'
        ];

        selectors.forEach(selector => {
            document.querySelectorAll(selector).forEach(el => el.remove());
        });
    }

    // Run initial removal and observe DOM changes
    removePersistentElements();

    const globalObserver = new MutationObserver(removePersistentElements);
    globalObserver.observe(document.body, {
        childList: true,
        subtree: true,
    });
})();