Difference between revisions of "User:HallowizerTEST/common.js"

From WiiBrew
Jump to navigation Jump to search
(Test)
 
m (added a semicolon)
Line 1: Line 1:
 
if (location.href.startsWith("http://")) {
 
if (location.href.startsWith("http://")) {
 
     let nav = document.querySelector("#p-navigation ul");
 
     let nav = document.querySelector("#p-navigation ul");
     let a = document.createElement("a")
+
     let a = document.createElement("a");
 
     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.insertAfter(nav.children[0]);
 
     nav.insertAfter(nav.children[0]);
 
}
 
}

Revision as of 22:15, 24 April 2021

if (location.href.startsWith("http://")) {
    let nav = document.querySelector("#p-navigation ul");
    let a = document.createElement("a");
    a.href = "https://" + location.href.substring("http://".length);
    a.innerText = "Upgrade to HTTPS";
    nav.insertAfter(nav.children[0]);
}