Prevent Zoom Pro Ads and Success Hash

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.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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        Prevent Zoom Pro Ads and Success Hash
// @namespace   https://github.com/DenverCoder1
// @version     0.0.4
// @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/j/*
// @match       https://*.zoom.us/s/*
// @match       https://*.zoom.us/postattendee
// @grant       none
// @author      Jonah Lawrence (DenverCoder1)
// @license     MIT
// ==/UserScript==

/* jshint esversion: 8 */

/**
 * Redirect success links containing the #success hash and "/s/" to the same link at /j/ without the hash.
 */
function redirectSuccessToJoin() {
    history.replaceState(null, null, window.location.href.replace("/s/", "/j/").replace(/#.*?$/, ""));
}

// if window contains a /postattendee (zoom ad), redirect to last join url or default url
if (window.location.href.includes("/postattendee")) {
    const lastJoinUrl = localStorage.getItem("lastJoinUrl");
    if (lastJoinUrl) {
        window.location.href = lastJoinUrl;
    } else {
        window.history.back();
        // fallback to default url if can't go back
        window.location.href = "https://google.com";
    }
}
// if on a success link, redirect to join link
else if (window.location.href.includes("/s/")) {
    redirectSuccessToJoin();
}

// check for the url to change, and turn it back into the /j/ url
window.addEventListener("hashchange", redirectSuccessToJoin);
// set last join link to redirect back to later
window.localStorage.setItem("lastJoinUrl", window.location.href);