User:Magicmat/minerva.js

if(!window.magicmatMinervaDidRun) { window.magicmatMinervaDidRun = true; console.debug("[magicmat] Executing Magicmat's Minerva skin custom JS (from https://en.wikipedia.org/wiki/User:Magicmat/minerva.js)"); // There's a bug in Minerva where, when it tries to execute our user // `common.js` script, it will crash with a "Unknown dependency: 'site'" // unhandled exception. Below is a super-hacky workaround that fixes that // by registering a mock "site" module (set to a dummy noop function) so	// that, when the user script is loaded, it is able to resolve the "site" // dependency, and finish loading/executing the user script. try { mw.loader.implement("site", function { /*console.debug("[magicmat] Mock 'site' module called (from https://en.wikipedia.org/wiki/User:Magicmat/minerva.js)"); */}); } catch(e) { console.warn("[magicmat] Error trying to mock 'site' module:", e, "(from https://en.wikipedia.org/wiki/User:Magicmat/minerva.js)"); } }