Created
May 8, 2024 19:52
-
-
Save sportshead/9e1aa8e47c648d71f9aa0036aae07fea to your computer and use it in GitHub Desktop.
vuejs.org uwuify
This file contains 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 vuejs.org uwuify | |
// @namespace sportshead.dev | |
// @version 2024-05-08 | |
// @description Redirects vuejs.org homepage links to vuejs.org?uwu | |
// @author sportshead | |
// @match https://vuejs.org/* | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
"use strict"; | |
const url = new URL(window.location.href); | |
if (!url.searchParams.has("uwu")) { | |
url.searchParams.append("uwu", ""); | |
window.location = url.toString(); | |
} | |
// navigating from another page to index | |
window.history.pushState = new Proxy(window.history.pushState, { | |
apply: (target, thisArg, argArray) => { | |
if (argArray[2] === "/") window.location = "/?uwu"; | |
return target.apply(thisArg, argArray); | |
}, | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment