Skip to content

Instantly share code, notes, and snippets.

@sportshead
Created May 8, 2024 19:52
Show Gist options
  • Save sportshead/9e1aa8e47c648d71f9aa0036aae07fea to your computer and use it in GitHub Desktop.
Save sportshead/9e1aa8e47c648d71f9aa0036aae07fea to your computer and use it in GitHub Desktop.
vuejs.org uwuify
// ==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