GeoGuessr Background Replacer

Replaces the background of the Geoguessr homepage with your own image

当前为 2023-05-17 提交的版本,查看 最新版本

// ==UserScript==
// @name         GeoGuessr Background Replacer
// @description  Replaces the background of the Geoguessr homepage with your own image
// @version      1.0
// @author       tyow
// @match        *://*.geoguessr.com/*
// @grant        none
// @license      MIT
// @namespace https://greasyfork.org/users/1011193
// ==/UserScript==


// Replace the url with an image of your choosing
const img = "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.wallpapersafari.com%2F6%2F80%2F9ZbpYo.jpg&f=1&nofb=1&ipt=ddb30ffb037e46ee933b0e3a566175f927faf57e5162b27bb15a5d71cf6e888d&ipo=images"

/* ############################################################################### */
/* ##### DON'T MODIFY ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING ##### */
/* ############################################################################### */

const checkGameMode = () => {
	return (location.pathname.startsWith("/duels/"));
}

const updateImage = () => {
    const imgEl = document.querySelector('.signed-in-start-page_backgroundImage__IR0w5');
    imgEl.src = img;
}



new MutationObserver(async (mutations) => {
    updateImage();
}).observe(document.body, { subtree: true, childList: true });