GeoGuessr Daily Challenge Click

Redirects to the Daily Challenge page when clicking the daily streak icon on the home page.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         GeoGuessr Daily Challenge Click
// @namespace    https://greasyfork.org/en/users/1168708-rotski
// @version      1.0
// @description  Redirects to the Daily Challenge page when clicking the daily streak icon on the home page.
// @author       rotski
// @license      MIT
// @match        https://www.geoguessr.com/*
// @icon         https://www.geoguessr.com/favicon.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function enableClickRedirect() {
        const target = document.querySelector('.daily-streak_root__njtkG');
        if (target && !target.dataset.listenerAdded) {
            // Redirect to Daily Challenge on click
            target.addEventListener('click', function(e) {
                e.stopPropagation();
                window.location.href = 'https://www.geoguessr.com/daily-challenges';
            });

            // Change cursor to pointer
            target.style.cursor = 'pointer';

            // Prevent duplicate listener
            target.dataset.listenerAdded = 'true';
        }
    }

    // Initial run
    enableClickRedirect();

    // Watch for dynamic loading
    const observer = new MutationObserver(enableClickRedirect);
    observer.observe(document.body, { childList: true, subtree: true });
})();