Skip to content

Instantly share code, notes, and snippets.

@Thadah
Last active November 28, 2023 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thadah/0cda88b2201d0c8a4c440dde1b08a430 to your computer and use it in GitHub Desktop.
Save Thadah/0cda88b2201d0c8a4c440dde1b08a430 to your computer and use it in GitHub Desktop.
Auto Join w2g.tv Room - Tampermonkey Script
// ==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