ZoomUtils

A bunch of small utilities for Zoom Web Meetings.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         ZoomUtils
// @namespace    https://letga.me/
// @version      0.3.1.1
// @description  A bunch of small utilities for Zoom Web Meetings.
// @author       LetGame
// @license      MIT
// @match        https://zoom.us/*
// @match        https://*.zoom.us/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zoom.us
// @grant        window.close
// ==/UserScript==

/* jshint esversion: 8 */

(function() {
    'use strict';

    const addTimer = async(element, seconds) => { // timer function
        const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); // sleep function for delays

        const text = element.innerText;
        for (var t = seconds; t > 0; t--) {
            element.innerText = text + ' (' + t + ')';
            await sleep(1000);
        }
        element.innerText = text + ' (0)';
        await sleep(100); // additional 100ms timeout to avoid bugs
    };

    const q = e => document.querySelector(e); // querySelector shortcut

    window.addEventListener('load', () => {
        q('body').style.fontFamily = "sans-serif"; // fix fonts

        if (window.location.href.match('zoom.us/j/')) { // web client redirector
            window.location.href = window.location.href.replace('/j/', '/wc/join/');
        }

        if (window.location.href.match('zoom.us/wc/leave')) {
            q('#change_bo').style.display = 'none'; // remove the annoying message to switch to chrome
            addTimer(q('.leave-wrap h1'), 5).then(() => {window.close();}); // auto close ended meetings
        }

        if (window.location.href.match('zoom.us/wc/join/')) {
            addTimer(q("#joinBtn"), 5).then(() => {q("#joinBtn").click();}); // auto join button press
        }
    });
})();