User:Surafbrov/common.js

// https://terraria.fandom.com/wiki/User:Mr_Pie_5/common.js // Replace webp images with their original format {	const images = document.querySelectorAll("#content img"); const regex = new RegExp(/cb=\d+/); images.forEach(function(image) {	   image.setAttribute("src", image.src.replace(regex, "format=original"));	}); }

$(function {   if (mw.config.get("wgCanonicalNamespace") !== "File") return;    var fileLink = $(".fullMedia a.internal");    var fileHref = fileLink.attr("href") + (fileLink.attr("href").includes('?') ? '&' : '?') + 'format=original';   fileLink.attr("href", fileHref); });