您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This script returns the old geoguessr duels UI but only in matches.
当前为
- // ==UserScript==
- // @name GeoGuessr Return Old Duels UI
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description This script returns the old geoguessr duels UI but only in matches.
- // @author AaronThug
- // @match https://www.geoguessr.com/*/multiplayer*
- // @match https://www.geoguessr.com/*
- // @run-at document-end
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- function getLanguagePrefix() {
- const url = window.location.pathname;
- const urlParts = url.split('/').filter(part => part.length > 0);
- if (urlParts[0] && urlParts[0].length <= 3 && urlParts[0] !== 'multiplayer') {
- return '/' + urlParts[0];
- }
- return '';
- }
- function handlePlayButtonClick(event) {
- if (!window.location.pathname.includes('/multiplayer')) {
- return;
- }
- let target = event.target;
- let isPlayButton = false;
- while (target && target !== document) {
- if (target.tagName === 'BUTTON') {
- const buttonText = target.textContent.trim();
- if (buttonText === 'Play' || buttonText === 'Spielen' ||
- buttonText === 'Jouer' || buttonText === 'Jugar' ||
- buttonText === 'Gioca' || buttonText === 'Spela') {
- isPlayButton = true;
- break;
- }
- }
- target = target.parentElement;
- }
- if (isPlayButton) {
- event.preventDefault();
- event.stopPropagation();
- const langPrefix = getLanguagePrefix();
- window.location.href = `https://www.geoguessr.com${langPrefix}/matchmaking`;
- console.log(`GeoGuessr Redirect: detour to ${langPrefix}/matchmaking`);
- return false;
- }
- }
- function setupEventListener() {
- document.addEventListener('click', handlePlayButtonClick, true);
- console.log('GeoGuessr detour: Click Listener installed');
- }
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', function() {
- setTimeout(setupEventListener, 500);
- });
- } else {
- setTimeout(setupEventListener, 500);
- }
- console.log('GeoGuessr Multiplayer Redirect: Script loaded');
- })();