Skip to content

Instantly share code, notes, and snippets.

@AlexCzar
Created July 8, 2020 12:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AlexCzar/2e55df163bc46541d07a851f9003fcbc to your computer and use it in GitHub Desktop.
Save AlexCzar/2e55df163bc46541d07a851f9003fcbc to your computer and use it in GitHub Desktop.
Script that automatically admits people to Google Meet meetings
// ==UserScript==
// @name Auto-Admit google meet
// @namespace Violentmonkey Scripts
// @match https://meet.google.com/
// @grant none
// @version 1.0
// @author Alex Czar
// @description 27/03/2020, 12:46:14
// ==/UserScript==
const clickEvent = new MouseEvent("click", {
view: window,
bubbles: true,
cancelable: true
});
const autoAdmit = (mutation) => {
if (!mutation.addedNodes) return
const element = document.querySelector(".XfpsVe > div:nth-child(2) > span:nth-child(3)");
element && element.dispatchEvent(clickEvent);
};
const observer = new MutationObserver((mutations) => mutations.forEach(autoAdmit));
observer.observe(
document.body,
{
childList: true,
subtree: true,
attributes: false,
characterData: false
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment