您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Leaderboard is synced with the selected game mode.
// ==UserScript== // @name GeoGuessr Mode and Leaderboard Sync // @namespace http://tampermonkey.net/ // @version 5.5 // @description Leaderboard is synced with the selected game mode. // @author Rotski // @license MIT // @match https://www.geoguessr.com/* // @grant none // ==/UserScript== (function() { 'use strict'; let lastURL = window.location.href; let observer; let lastSyncedMode = ''; // Keeps track of the last synchronized mode to avoid redundant updates function simulateClickOnSwitch(labelText) { const targetSwitch = [...document.querySelectorAll('.switch_label__KrnMF')].find(label => label.textContent.trim() === labelText); if (targetSwitch) { targetSwitch.click(); } else { console.error(`Leaderboard switch for "${labelText}" not found.`); } } function checkAndSyncLeaderboard() { const activeModeButton = document.querySelector('.play-setting-button_root__AfG8z.play-setting-button_selected__A0_ik label'); if (activeModeButton) { const activeModeText = activeModeButton.textContent.trim(); if (activeModeText !== lastSyncedMode) { // Only sync if the mode has changed lastSyncedMode = activeModeText; simulateClickOnSwitch(activeModeText); } } else { console.error('Active mode button not found.'); } } function setupObserver() { observer = new MutationObserver(mutations => { if (mutations.some(mutation => mutation.addedNodes.length || mutation.attributeName)) { checkAndSyncLeaderboard(); } }); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] }); } function monitorUrlChanges() { setInterval(() => { const currentURL = window.location.href; if (currentURL !== lastURL && currentURL.includes('/maps/')) { lastSyncedMode = ''; // Reset to ensure sync occurs checkAndSyncLeaderboard(); lastURL = currentURL; } }, 5000); // Reduced frequency to lessen impact } document.addEventListener('click', function(event) { if (event.target.closest('.play-setting-button_root__AfG8z.play-setting-button_selected__A0_ik')) { setTimeout(checkAndSyncLeaderboard, 100); } }); window.addEventListener('load', () => { setupObserver(); checkAndSyncLeaderboard(); monitorUrlChanges(); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址