User:Erutuon/common.js

function paramsFromObj(obj) { const params = new URLSearchParams; for (const [k, v] of Object.entries(obj)) { params.set(k, v); }	return params; }

window.loadScript = function (pageName) { const url = new URL(mw.config.get("wgServer") + mw.config.get("wgScript")); url.search = paramsFromObj({		title: pageName,		action: "raw",		ctype: "text/javascript",	}); mw.loader.load(url); };

$(function {	loadScript("User:Erutuon/scripts/codeLinks.js"); });