Last active
April 21, 2025 11:39
-
-
Save pombadev/dde20daebc8aeef27eebb70eb220ff96 to your computer and use it in GitHub Desktop.
gather.town pain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name gather.town pain | |
// @namespace Violentmonkey Scripts | |
// @match https://app.gather.town/* | |
// @grant none | |
// @version 1.1 | |
// @author pombadev | |
// @description Just login | |
// ==/UserScript== | |
// gather doesnt support FF well, we need this for QOL | |
if (navigator.userAgent.match(/Firefox\/\d.+$/)) { | |
const targetNode = document.body; | |
const config = { attributes: true, childList: true, subtree: true }; | |
const observer = new MutationObserver(function (mutationList, observer) { | |
for (const mutation of mutationList) { | |
if (mutation.type === "childList") { | |
if (/MEMBERS\s+\d+/i.test(document.body.innerText)) { | |
observer.disconnect(); | |
console.info("disconnected, nothing to do now"); | |
} | |
const buttons = Array.from(mutation.target.querySelectorAll("button")); | |
const proceed = buttons.find( | |
(el) => el.innerText === "I understand and wish to proceed", | |
); | |
if (proceed) { | |
proceed.click(); | |
} | |
const join = buttons.find((el) => el.innerText === "Join"); | |
if (buttons.length === 4 && join) { | |
join.click(); | |
} | |
const spans = Array.from(document.querySelectorAll("span")); | |
const launch = spans.find( | |
(span) => span.innerText === "No thanks, launch in browser instead", | |
); | |
if (launch) { | |
launch.click(); | |
} | |
} | |
} | |
}); | |
observer.observe(targetNode, config); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment