Difference between revisions of "User:HallowizerTEST/common.js"
Jump to navigation
Jump to search
(Switched to var) |
(Fixed insertAfter) |
||
Line 4: | Line 4: | ||
a.href = "https://" + location.href.substring("http://".length); | a.href = "https://" + location.href.substring("http://".length); | ||
a.innerText = "Upgrade to HTTPS"; | a.innerText = "Upgrade to HTTPS"; | ||
− | nav. | + | nav.insertBefore(nav.children[1]); |
} | } |
Revision as of 23:18, 24 April 2021
if (location.href.startsWith("http://")) {
var nav = document.querySelector("#p-navigation ul");
var a = document.createElement("a");
a.href = "https://" + location.href.substring("http://".length);
a.innerText = "Upgrade to HTTPS";
nav.insertBefore(nav.children[1]);
}