// ==UserScript== // @name Geoguessr Better Menu Test // @namespace https://greasyfork.org/en/users/997484-aimee4737 // @version 1.3 // @description Adds a menu bar to Geoguessr's new UI // @author aimee // @match https://www.geoguessr.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=geoguessr.com // @grant none // @license MIT // @downloadURL none // ==/UserScript== // edit line 34 for custom menu items window.addEventListener("load", function() { const start = `
` const end = `
` const singleplayer = start + `Singleplayer` + end const competitive = start + `Competitive` + end const party = start + `Party` + end const quiz = start + `Quiz` + end const ongoingGames = start + `Ongoing Games` + end const activities = start + `Activities` + end const myMaps = start + `My Maps` + end const likedMaps = start + `Liked Maps` + end // const html = singleplayer + competitive + party + quiz + ongoingGames + activities + myMaps + likedMaps const html = singleplayer + competitive + party + quiz + ongoingGames + activities + myMaps + likedMaps const headers = document.getElementsByTagName("header") const header = headers[0] const menu = header.childNodes[1] menu.style.display = "flex" const newItems = document.createElement("div") newItems.innerHTML = html newItems.style.display = "flex" menu.prepend(newItems) // keeping the original labels fixes issues with "crashes" links on pages are clicked const newDivs = newItems.getElementsByClassName("slanted-wrapper_root__2eaEs") const menuItems = menu.getElementsByClassName("slanted-wrapper_root__2eaEs") const menuLinks = menu.getElementsByClassName("label_sizeXSmall__mFnrR") // hides original label if (menuItems.length > newDivs.length) { menuItems[menuItems.length-1].style.display = "none" } // shows active page const url = window.location.href for (let i=0; i