🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Auto-close Zoom join pages

Closes a Zoom join page after a few minutes, so you don't have to manually close it after the call

คุณจะต้องติดตั้งส่วนขยาย เช่น 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.

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         Auto-close Zoom join pages
// @namespace    http://tampermonkey.net/
// @version      2025-10-30
// @description  Closes a Zoom join page after a few minutes, so you don't have to manually close it after the call
// @author       joeytwiddle
// @license      ISC
// @match        https://*.zoom.us/j/*
// @match        https://zoom.us/j/*
// @include      https://*.zoom.tld/j/*
// @include      https://zoom.tld/j/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zoom.us
// @grant        window.close
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Weirdly, this script will only execute if we run-at document-start
    // But running at document-start means we need to wait a while before we can check the page content. Hence this setTimeout.
    // To reproduce: Chrome on macOS, and do not test with Reload (which works more easily). Be sure to test by clicking the Zoom link again (e.g. from Google Calendar) to open a fresh page.
    setTimeout(() => {
        const $ = s => document.querySelector(s);

        const isZoomJoinPage = $('#zoom-ui-frame') || $('#zoom-ui-container');

        if (isZoomJoinPage) {
            // Close the window later
            setTimeout(() => {
                window.close();
            }, 60 * 1000);

            // Advertise that this script is running
            const existingTextElement = $('#zoom-ui-frame h2');
            const ourTextElement = document.createElement('h2');
            ourTextElement.textContent = '(This page will auto-close soon)';
            ourTextElement.style.opacity = '0.6';
            existingTextElement.parentNode.appendChild(ourTextElement);
        }
    }, 1.5 * 1000);
})();