Jump to content

MediaWiki:Common.js: Difference between revisions

From The Commentary Community Wiki
Created page with "Any JavaScript here will be loaded for all users on every page load.: if (document.querySelector(".force-vector-night")) { const url = new URL(window.location.href); url.searchParams.set("useskin", "vector"); url.searchParams.set("vectornightmode", "1"); if (window.location.href !== url.toString()) { window.location.replace(url.toString()); } }"
 
No edit summary
Tag: Manual revert
 
(8 intermediate revisions by the same user not shown)
Line 4: Line 4:
     const url = new URL(window.location.href);
     const url = new URL(window.location.href);


    url.searchParams.set("useskin", "vector");
     url.searchParams.set("vectornightmode", "1");
     url.searchParams.set("vectornightmode", "1");



Latest revision as of 02:59, 13 March 2026

/* Any JavaScript here will be loaded for all users on every page load. */

if (document.querySelector(".force-vector-night")) {
    const url = new URL(window.location.href);

    url.searchParams.set("vectornightmode", "1");

    if (window.location.href !== url.toString()) {
        window.location.replace(url.toString());
    }
}