-
-
Save a-c-m/86a10ad240e23f778b2564a459238df8 to your computer and use it in GitHub Desktop.
Zoom: Auto-Close App Bouncer Tab #userscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Zoom: Auto-Close App Bouncer Tab | |
// @namespace https://bignerdranch.com/ | |
// @version 1.1 | |
// @description Close the tab Zoom uses to redirect to its app after several seconds. | |
// @author Jeremy W. Sherman <[email protected]> | |
// @author Alex McFadyen <[email protected]> | |
// @downloadURL https://gist.github.com/a-c-m/86a10ad240e23f778b2564a459238df8/raw/zoom-auto-close-tab.user.js | |
// @match https://zoom.us/j/* | |
// @match https://*.zoom.us/j/* | |
// @grant none | |
// ==/UserScript== | |
console.log('Auto-closing tab script loaded'); | |
(function() { | |
'use strict'; | |
const secondsToWait = 5; | |
console.log('Auto-closing tab in %d seconds.', secondsToWait); | |
const secondsAsMilliseconds = 1000; | |
const milliseconds = secondsToWait * secondsAsMilliseconds; | |
setTimeout(function() { | |
console.log('Auto-closing tab.'); | |
window.close(); | |
// FF needs about:config dom.allow_scripts_to_close_windows = true | |
// see https://stackoverflow.com/questions/2076299/how-to-close-current-tab-in-a-browser-window#2076307 | |
alert("Tab didn't close - If on FF, set `about:config` `dom.allow_scripts_to_close_windows = true`"); | |
}, milliseconds); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment