Im trying Tampermonkey to close Google Meet ( or the browser, but the final objective is to leave the meeting), when it get "x" participants.

In the console it shows (roomates, null) I think it is just ruinning the code when the page starts, but I dont know how to loop it.

After the script be able to define the variable the number of participants I will try to do an If () and close page.

If there s any better ideas I would be grateful The only thing I could get without errors was this:

// ==UserScript==
// @name         Sair Meet
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Get out classroom if "x" roomates in the room.
// @author       MTRD
// @match http://*/*
// @match https://meet.google.com//*
// @match https://meet.google.com/*
// @grant        none
// ==/UserScript==

var roomates = document.querySelector("#ow3 > div.T4LgNb > div > div:nth-child(4) > div.crqnQb > div.pHsCke > div.Jrb8ue > div > div.NzPR9b > div.uArJ5e.UQuaGc.kCyAyd.kW31ib.foXzLb.IeuGXd.M9Bg4d > span > span > div > div > span.wnPUne.N0PJ8e");

(function() {
    'use strict';
   console.log("roomates:" , roomates);


Note: this document.querySelector, is the JS path that I got from the meet page, inspecting the element, it is the same for all meetings, just the string(roomates) that changes.