// ==UserScript== // @name Prevent Zoom Pro Ads and Success Hash // @namespace https://github.com/DenverCoder1 // @version 0.0.3 // @description Prevents the #success Hash on Zoom join links to allow sharing the link with others and prevents Zoom Pro ads from appearing after the button is clicked. // @match https://*zoom.us/s/* // @include https://*.zoom.us/[js]/* // @grant none // @author Jonah Lawrence (DenverCoder1) // @license MIT // @downloadURL none // ==/UserScript== /* jshint esversion: 8 */ window.addEventListener("hashchange", () => history.replaceState(null, null, window.location.href.replace("/s/", "/j/").replace(/#.*?$/, ""))); /** * Whether or not to prompt when a redirect occurs * @type {string} */ window.blockRedirect = true; // prompt on redirect if window.blockRedirect is true window.onbeforeunload = function(e) { if (window.blockRedirect) { const message = "Are you sure you want to leave?"; e.preventDefault(); e.returnValue = message; return message } }; // unblock redirects if clicked on a link document.body.addEventListener("click", function (e) { if (e.target.closest("a")) { window.blockRedirect = false; } });