User:CodeMyGame Wiki/common.js

//console.log(window.location.href); /* jshint esversion: 8 */

function loadJQuery { var script_tag = document.createElement(" "); script_tag.src("https://code.jquery.com/jquery-3.6.1.js"); document.getElementsByTagName("head")[0].appendChild(script_tag); }

function checkURl { if (document.title.includes("Typo Team")) { document.title = "TYPO"; }	if (window.location.href == "https://en.wikipedia.org/wiki/Wikipedia:Typo_Team") { fetch("https://en.wikipedia.org/wiki/Wikipedia:Typo_Team/moss") .then(function (response) { return response.text; }) .then(function (text) {				var html = $(text);				var stuff = html.find("#mw-content-text > div.mw-parser-output > ul:nth-child(50)");				stuff.children.each(function { $(this).children("b").each(function {						if ($(this)) {							var target_link = $(this).children("a").prop("href");							if (target_link.startsWith("https://en.wikipedia.org/")) {								window.location.replace(target_link);								}						}					}) });			});	} }

checkURl;