Last active
November 28, 2023 18:39
-
-
Save Thadah/0cda88b2201d0c8a4c440dde1b08a430 to your computer and use it in GitHub Desktop.
Auto Join w2g.tv Room - Tampermonkey Script
This file contains 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 Auto Join w2g.tv Room | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0.1 | |
// @description Automatically click the 'Join the Room' button on w2g.tv | |
// @author Thadah D. Denyse | |
// @match *://w2g.tv/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function tryJoinRoom() { | |
// Site dimmer is the div that prevents page load and has the join room modal inside | |
var siteDimmer = document.getElementById('site-dimmer') | |
// This is the link behind the w2g-join-button div | |
var joinLink = document.getElementById('w2g-join-link'); | |
// Check if the button is available and the dimmer hasn't been hidden | |
if (joinLink && !siteDimmer.classList.contains('hidden')) { | |
joinLink.click(); | |
} else { | |
// Retry if button not found | |
setTimeout(tryJoinRoom, 100); | |
} | |
} | |
tryJoinRoom(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment