OpenGuessr Cheat (V2)

Updated! The best OpenGuessr cheat available! Activate by pressing "1" or clicking button

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         OpenGuessr Cheat (V2)
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Updated! The best OpenGuessr cheat available! Activate by pressing "1" or clicking button
// @author       OpenGuessr Team
// @match        https://openguessr.com/*
// @license MIT
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    function openGoogleMapFromEmbedUrl(embedUrl) {
        const match = embedUrl.match(/location=([-.\d]+),([-.\d]+)/);
        if (match && match.length === 3) {
            const lat = match[1];
            const lng = match[2];
            const mapUrl = `https://www.google.com/maps?q=${lat},${lng}`;
            window.open(mapUrl, '_blank');
        } else {
            console.error('Invalid embed URL or coordinates not found.');
        }
    }

    function getEmbedUrl() {
        const iframe = document.getElementById('PanoramaIframe');
        return iframe ? iframe.src : null;
    }

    function handleMapOpen() {
        const url = getEmbedUrl();
        if (url) {
            openGoogleMapFromEmbedUrl(url);
        } else {
            console.error('Panorama iframe not found.');
        }
    }

    function injectButton() {
        setTimeout(() => {
        const button = document.createElement('button');
        button.textContent = 'Open in Google Maps';
        button.style.position = 'fixed';
        button.style.top = '10px';
        button.style.right = '10px';
        button.style.zIndex = '9999';
        button.style.padding = '8px 12px';
        button.style.backgroundColor = '#fff';
        button.style.border = '1px solid #ccc';
        button.style.borderRadius = '4px';
        button.style.boxShadow = '0 2px 6px rgba(0,0,0,0.15)';
        button.style.cursor = 'pointer';
        button.style.fontSize = '14px';
        button.style.fontFamily = 'Arial, sans-serif';

        button.addEventListener('click', handleMapOpen);
        document.body.appendChild(button);
        }, 2000);
    }

    // Keyboard listener
    window.addEventListener('keydown', function (e) {
        if (e.key === '1') {
            handleMapOpen();
        }
    });

    // Wait for the page to load completely before injecting the button
    window.addEventListener('load', injectButton);
})();