New js to add .php if served locally [dev]

This commit is contained in:
CommanderRedYT committed 2020-11-30 17:52:50 +01:00
1 parent 1fa0ed1a9c
commit 2b2106c0b5
3 files changed
+26 -16

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
function givePHP() {
var elements = document.getElementsByClassName("givePHP");
len = elements !== null ? elements.length : 0;
i = 0;
for (i; i < len; i++) {
if(elements[i].href != "http://localhost/")
elements[i].href += ".php";
}
}
+1
View File
@@ -99,6 +99,7 @@ function load() {
setCookie("darkmode", false, 999);
}
checkDarkmode();
if(location.hostname == "localhost") givePHP();
}
/*Cookie scripts*/