Geoguessr Blink Mode

Shows the round briefly, then screen goes black and you have unlimited time to make your guess.

目前为 2022-04-08 提交的版本。查看 最新版本

// ==UserScript==
// @name         Geoguessr Blink Mode
// @description  Shows the round briefly, then screen goes black and you have unlimited time to make your guess.
// @version      0.1.2
// @author       macca#8949
// @license      MIT
// @include      https://www.geoguessr.com/*
// @run-at       document-start
// @grant        none
// @namespace    https://gf.qytechs.cn/en/scripts/438579-geoguessr-blink-mode
// ==/UserScript==

const timeLimit = 1.5; // MODIFY THIS IF YOU WANT TO CHANGE THE TIME

async function checkElement(selector) {
    while (document.querySelector(selector) === null) {
        await new Promise(resolve => requestAnimationFrame(resolve));
    }
    return document.querySelector(selector);
}

function respondToVisibility(element, callback) {
    let options = {
        root: document.documentElement
    }

    let observer = new IntersectionObserver((entries, observer) => {
        entries.forEach(entry => {
            callback(entry.intersectionRatio > 0);
        });
    }, options);

    observer.observe(element);
}

checkElement('.widget-scene-canvas').then((canvas) => {
    respondToVisibility(canvas, visible => {
        setTimeout(() => {
            canvas.style.display = 'none';
        }, (timeLimit + 0.5) * 1000);
    });
});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址