Skip to content

Instantly share code, notes, and snippets.

@JamesYeoman
Last active October 28, 2023 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesYeoman/cdda215151db29c9c374b5ecab271799 to your computer and use it in GitHub Desktop.
Save JamesYeoman/cdda215151db29c9c374b5ecab271799 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Pathbuilder 2e Temp Fix
// @namespace https://github.com/JamesYeoman
// @version 0.1
// @description Temporarily patch a dodgy JS issue
// @author https://github.com/JamesYeoman
// @match https://pathbuilder2e.com/app.html?v=71a
// @updateURL https://gist.github.com/JamesYeoman/cdda215151db29c9c374b5ecab271799/raw/pathbuilder2e.user.js
// @downloadURL https://gist.github.com/JamesYeoman/cdda215151db29c9c374b5ecab271799/raw/pathbuilder2e.user.js
// @icon none
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener("load", function() {
if ("jwt_decode" in window) return;
// No redirects registered for the broken script src. Time to load v3.1.2
let nonESM = document.createElement("script");
nonESM.setAttribute("src", "https://unpkg.com/jwt-decode@3.1.2/build/jwt-decode.js");
document.getElementsByTagName("head")[0].append(nonESM);
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment