diff --git a/README.md b/README.md
index 9ff4081d..cbc708d4 100644
--- a/README.md
+++ b/README.md
@@ -28,20 +28,21 @@ The Proxy is a modern version of Interstellar, but since release everything has
- Geforce NOW Support
### Install Instructions
-```git clone https://github.com/zgr2575/SlowGuardian```
+
+`git clone https://github.com/zgr2575/SlowGuardian`
-```cd SlowGuardian```
+`cd SlowGuardian`
-```npm install```
+`npm install`
-```npm start```
+`npm start`
Updating
-```cd SlowGuardian```
-```git pull --force --allow-unrelated-histories```
-
+`cd SlowGuardian`
+`git pull --force --allow-unrelated-histories`
---
+
TO UPDATE OR DO ANYTHING ON REPLIT, PLEASE REFFER TO OLD INSTRUCTON ON THE V7
LONG TERM SUPPORT BRANCH, WE NOW SUPPORT EVERYTHING. REPLIT DEVELOPMENT DISCONTINUED
diff --git a/index.js b/index.js
index 0b424929..6670c5d2 100644
--- a/index.js
+++ b/index.js
@@ -10,9 +10,10 @@ const server = http.createServer();
const app = express(server);
const bareServer = createBareServer("/o/");
const PORT = process.env.PORT || 8080;
-var v = config.version;
-var upd = false;
+const v = config.version;
+let upd = false;
import readline from "readline";
+import { exec } from "node:child_process";
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(cors());
@@ -25,7 +26,7 @@ if (config.routes !== false) {
{ path: "/s", file: "settings.html" },
{ path: "/p", file: "go.html" },
{ path: "/li", file: "login.html" },
- { path: "/tos", file: "tos.html" }
+ { path: "/tos", file: "tos.html" },
];
routes.forEach((route) => {
@@ -34,43 +35,45 @@ if (config.routes !== false) {
});
});
}
-var serverid = Math.floor(Math.random() * 101);
+const serverid = Math.floor(Math.random() * 101);
-var db=
+let db =
"server: Smarter Back End v5" +
+ " | version: " +
+ v +
+ " | update available: " +
+ upd +
+ "| server uptime:" +
+ process.uptime() +
+ " | server memory: " +
+ process.memoryUsage().heapUsed / 1024 / 1024 +
+ " | serverid: " +
+ serverid +
+ " | server identity: " +
+ "could not get";
+app.get("/d/data", (req, res, next) => {
+ console.log(
+ "[SMARTERBACKEND]: SERVER DATA HAS BEEN REQUESTED | STATUS: PACKAGING",
+ );
+ db =
+ "server: Smarter Back End v5" +
" | version: " +
v +
- " | update avalible: " +
+ " | update available: " +
upd +
- "| server uptime:" +
+ "| server uptime: " +
process.uptime() +
" | server memory: " +
process.memoryUsage().heapUsed / 1024 / 1024 +
- "serverid: " +
+ " | serverid: " +
serverid +
- "server identity: " +
- "could not get";
-app.get("/d/data", (req, res, next) => {
- console.log("[SMARTERBACKEND]: SERVER DATA HAS BEEN REQUESTED | STATUS: PACKAGING");
- db =
- "server: Smarter Back End v5" +
- " | version: " +
- v +
- " | update avalible: " +
- upd +
- "| server uptime:" +
- process.uptime() +
- " | server memory: " +
- process.memoryUsage().heapUsed / 1024 / 1024 +
- " serverid: " +
- serverid +
- " server identity: " +
- "SG SERVER"
- ;
- console.log("[SMARTERBACKEND]: SERVER DATA HAS BEEN PACKAGED | STATUS: PACKAGED, SENDING");
- res.send(db);
- console.log("[SMARTERBACKEND]: SERVER DATA HAS BEEN SENT | STATUS: SENT");
-
+ " server identity: " +
+ "SG SERVER";
+ console.log(
+ "[SMARTERBACKEND]: SERVER DATA HAS BEEN PACKAGED | STATUS: PACKAGED, SENDING",
+ );
+ res.send(db);
+ console.log("[SMARTERBACKEND]: SERVER DATA HAS BEEN SENT | STATUS: SENT");
});
if (config.local !== false) {
app.get("/e/*", (req, res, next) => {
@@ -111,7 +114,7 @@ server.on("upgrade", (req, socket, head) => {
fetch("https://raw.githubusercontent.com/zgr2575/SlowGuardian/main/version.txt")
.then((response) => response.text())
.then((data) => {
- console.log("[SLOWGUARDIAN]: CURRENT VERSION: " + data);
+ console.log("[SLOWGUARDIAN]: CURRENT VERSION: " + data);
if (v == parseInt(data)) {
console.log("[SLOWGUARDIAN]: UP TO DATE");
upd = true;
@@ -132,9 +135,8 @@ fetch("https://raw.githubusercontent.com/zgr2575/SlowGuardian/main/version.txt")
}
console.log(`Update: ${stdout}`);
});
- }
- else {
- conosle.log("Okay, exiting...");
+ } else {
+ console.log("Okay, exiting...");
process.exit(0);
}
rl.close();
@@ -183,10 +185,9 @@ if (config.challenge) {
}
// -------------------------
- server.on("listening", () => {
- console.log(`[SBE]: LISTENING ON PORT ${PORT}`);
- });
-
+server.on("listening", () => {
+ console.log(`[SBE]: LISTENING ON PORT ${PORT}`);
+});
server.listen({
port: PORT,
diff --git a/static/assets/scripts/h.js b/static/assets/scripts/h.js
index 16dd603c..69ce798c 100644
--- a/static/assets/scripts/h.js
+++ b/static/assets/scripts/h.js
@@ -1,49 +1,52 @@
-let inFrame
+let inFrame;
try {
- inFrame = window !== top
+ inFrame = window !== top;
} catch (e) {
- inFrame = true
+ inFrame = true;
}
if (!inFrame && !navigator.userAgent.includes("Firefox")) {
- const popup = open("about:blank", "_blank")
+ const popup = open("about:blank", "_blank");
if (!popup || popup.closed) {
- alert("Please allow popups and redirects.")
+ alert("Please allow popups and redirects.");
} else {
- const doc = popup.document
- const iframe = doc.createElement("iframe")
- const style = iframe.style
- const link = doc.createElement("link")
+ const doc = popup.document;
+ const iframe = doc.createElement("iframe");
+ const style = iframe.style;
+ const link = doc.createElement("link");
- const name = localStorage.getItem("name") || "My Drive - Google Drive"
- const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"
+ const name = localStorage.getItem("name") || "My Drive - Google Drive";
+ const icon =
+ localStorage.getItem("icon") ||
+ "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png";
- doc.title = name
- link.rel = "icon"
- link.href = icon
+ doc.title = name;
+ link.rel = "icon";
+ link.href = icon;
- iframe.src = location.href
- style.position = "fixed"
- style.top = style.bottom = style.left = style.right = 0
- style.border = style.outline = "none"
- style.width = style.height = "100%"
+ iframe.src = location.href;
+ style.position = "fixed";
+ style.top = style.bottom = style.left = style.right = 0;
+ style.border = style.outline = "none";
+ style.width = style.height = "100%";
- doc.head.appendChild(link)
- doc.body.appendChild(iframe)
+ doc.head.appendChild(link);
+ doc.body.appendChild(iframe);
- const pLink = localStorage.getItem(encodeURI("pLink")) || "https://www.nasa.gov/"
- location.replace(pLink)
+ const pLink =
+ localStorage.getItem(encodeURI("pLink")) || "https://www.nasa.gov/";
+ location.replace(pLink);
- const script = doc.createElement("script")
+ const script = doc.createElement("script");
script.textContent = `
window.onbeforeunload = function (event) {
const confirmationMessage = 'Leave Site?';
(event || window.event).returnValue = confirmationMessage;
return confirmationMessage;
};
- `
- doc.head.appendChild(script)
+ `;
+ doc.head.appendChild(script);
}
}
// Particles
@@ -158,24 +161,21 @@ document.addEventListener("DOMContentLoaded", function (event) {
},
},
retina_detect: true,
- }
- particlesJS("particles-js", particlesConfig)
+ };
+ particlesJS("particles-js", particlesConfig);
}
-})
+});
// Splash
-let SplashT = [
- "SlowGuardian will be back next year!",
+let SplashT = ["SlowGuardian will be back next year!"];
-];
-
-let SplashI = Math.floor(Math.random() * SplashT.length)
-const SplashE = document.getElementById("splash")
+let SplashI = Math.floor(Math.random() * SplashT.length);
+const SplashE = document.getElementById("splash");
function US() {
- SplashI = (SplashI + 1) % SplashT.length
- SplashE.innerText = SplashT[SplashI]
+ SplashI = (SplashI + 1) % SplashT.length;
+ SplashE.innerText = SplashT[SplashI];
}
-SplashE.innerText = SplashT[SplashI]
+SplashE.innerText = SplashT[SplashI];
-SplashE.addEventListener("click", US)
\ No newline at end of file
+SplashE.addEventListener("click", US);
diff --git a/static/assets/scripts/settings.js b/static/assets/scripts/settings.js
index 8347e154..29e9e82e 100644
--- a/static/assets/scripts/settings.js
+++ b/static/assets/scripts/settings.js
@@ -2,330 +2,322 @@
document.addEventListener("DOMContentLoaded", function () {
function adChange(selectedValue) {
if (selectedValue === "default") {
- localStorage.setItem("ad", "on")
+ localStorage.setItem("ad", "on");
} else if (selectedValue === "off") {
- localStorage.setItem("ad", "off")
+ localStorage.setItem("ad", "off");
}
}
- var adTypeElement = document.getElementById("adType")
+ var adTypeElement = document.getElementById("adType");
if (adTypeElement) {
adTypeElement.addEventListener("change", function () {
- var selectedOption = this.value
- adChange(selectedOption)
- })
+ var selectedOption = this.value;
+ adChange(selectedOption);
+ });
- var storedAd = localStorage.getItem("ad")
+ var storedAd = localStorage.getItem("ad");
if (storedAd === "on") {
- adTypeElement.value = "default"
+ adTypeElement.value = "default";
} else if (storedAd === "off") {
- adTypeElement.value = "off"
+ adTypeElement.value = "off";
} else {
- adTypeElement.value = "default"
+ adTypeElement.value = "default";
}
}
// Makes the custom icon and name persistent
- const iconElement = document.getElementById("icon")
- const nameElement = document.getElementById("name")
- const customIcon = localStorage.getItem("CustomIcon")
- const customName = localStorage.getItem("CustomName")
- iconElement.value = customIcon
- nameElement.value = customName
+ const iconElement = document.getElementById("icon");
+ const nameElement = document.getElementById("name");
+ const customIcon = localStorage.getItem("CustomIcon");
+ const customName = localStorage.getItem("CustomName");
+ iconElement.value = customIcon;
+ nameElement.value = customName;
- localStorage.setItem("ab", true)
- document.getElementById("ab-settings-switch").checked = true
-})
+ localStorage.setItem("ab", true);
+ document.getElementById("ab-settings-switch").checked = true;
+});
// Dyn
document.addEventListener("DOMContentLoaded", function () {
function pChange(selectedValue) {
if (selectedValue === "uv") {
- localStorage.setItem("uv", "true")
- localStorage.setItem("dy", "false")
+ localStorage.setItem("uv", "true");
+ localStorage.setItem("dy", "false");
} else if (selectedValue === "dy") {
- localStorage.setItem("uv", "false")
- localStorage.setItem("dy", "true")
+ localStorage.setItem("uv", "false");
+ localStorage.setItem("dy", "true");
}
}
- var pChangeElement = document.getElementById("pChange")
+ var pChangeElement = document.getElementById("pChange");
if (pChangeElement) {
pChangeElement.addEventListener("change", function () {
- var selectedOption = this.value
- pChange(selectedOption)
- })
+ var selectedOption = this.value;
+ pChange(selectedOption);
+ });
- var storedP = localStorage.getItem("uv")
+ var storedP = localStorage.getItem("uv");
if (storedP === "true") {
- pChangeElement.value = "uv"
- } else if (localStorage.getItem("dy") === "true" || localStorage.getItem("dy") === "auto") {
- pChangeElement.value = "dy"
+ pChangeElement.value = "uv";
+ } else if (
+ localStorage.getItem("dy") === "true" ||
+ localStorage.getItem("dy") === "auto"
+ ) {
+ pChangeElement.value = "dy";
} else {
- pChangeElement.value = "uv"
+ pChangeElement.value = "uv";
}
}
-})
+});
// Key
-let eventKey = localStorage.getItem("eventKey") || "`"
-let eventKeyRaw = localStorage.getItem("eventKeyRaw") || "`"
-let pLink = localStorage.getItem("pLink") || "https://classroom.google.com/"
+let eventKey = localStorage.getItem("eventKey") || "`";
+let eventKeyRaw = localStorage.getItem("eventKeyRaw") || "`";
+let pLink = localStorage.getItem("pLink") || "https://classroom.google.com/";
document.addEventListener("DOMContentLoaded", function () {
- document.getElementById("eventKeyInput").value = eventKeyRaw
- document.getElementById("linkInput").value = pLink
+ document.getElementById("eventKeyInput").value = eventKeyRaw;
+ document.getElementById("linkInput").value = pLink;
- const selectedOption = localStorage.getItem("selectedOption")
+ const selectedOption = localStorage.getItem("selectedOption");
if (selectedOption) {
- updateHeadSection(selectedOption)
+ updateHeadSection(selectedOption);
}
-})
+});
-const eventKeyInput = document.getElementById("eventKeyInput")
+const eventKeyInput = document.getElementById("eventKeyInput");
eventKeyInput.addEventListener("input", function () {
- eventKey = eventKeyInput.value.split(",")
-})
+ eventKey = eventKeyInput.value.split(",");
+});
-var linkInput = document.getElementById("linkInput")
+const linkInput = document.getElementById("linkInput");
linkInput.addEventListener("input", function () {
- pLink = linkInput.value
-})
+ pLink = linkInput.value;
+});
function saveEventKey() {
- eventKey = eventKeyInput.value.split(",")
- eventKeyRaw = eventKeyInput.value
- localStorage.setItem("eventKey", JSON.stringify(eventKey))
- localStorage.setItem("pLink", pLink)
- localStorage.setItem("eventKeyRaw", eventKeyRaw)
- window.location = window.location
+ eventKey = eventKeyInput.value.split(",");
+ eventKeyRaw = eventKeyInput.value;
+ localStorage.setItem("eventKey", JSON.stringify(eventKey));
+ localStorage.setItem("pLink", pLink);
+ localStorage.setItem("eventKeyRaw", eventKeyRaw);
+ window.location = window.location;
}
// Tab Cloaker
-var dropdown = document.getElementById("dropdown")
-var options = dropdown.getElementsByTagName("option")
+const dropdown = document.getElementById("dropdown");
+const options = dropdown.getElementsByTagName("option");
-var sortedOptions = Array.from(options).sort(function (a, b) {
- return a.textContent.localeCompare(b.textContent)
-})
+const sortedOptions = Array.from(options).sort(function (a, b) {
+ return a.textContent.localeCompare(b.textContent);
+});
while (dropdown.firstChild) {
- dropdown.removeChild(dropdown.firstChild)
+ dropdown.removeChild(dropdown.firstChild);
}
sortedOptions.forEach(function (option) {
- dropdown.appendChild(option)
-})
-
-function saveIcon() {
- const iconElement = document.getElementById("icon")
- const iconValue = iconElement.value
- console.log("saveIcon function called with icon value:", iconValue)
- localStorage.setItem("icon", iconValue)
-}
-
-function saveName() {
- const nameElement = document.getElementById("name")
- const nameValue = nameElement.value
- console.log("saveName function called with name value:", nameValue)
- localStorage.setItem("name", nameValue)
-}
+ dropdown.appendChild(option);
+});
function CustomIcon() {
- const iconElement = document.getElementById("icon")
- const iconValue = iconElement.value
- console.log("saveIcon function called with icon value:", iconValue)
- localStorage.setItem("CustomIcon", iconValue)
+ const iconElement = document.getElementById("icon");
+ const iconValue = iconElement.value;
+ console.log("CustomIcon function called with icon value:", iconValue);
+ localStorage.setItem("CustomIcon", iconValue);
}
function CustomName() {
- const nameElement = document.getElementById("name")
- const nameValue = nameElement.value
- console.log("saveName function called with name value:", nameValue)
- localStorage.setItem("CustomName", nameValue)
+ const nameElement = document.getElementById("name");
+ const nameValue = nameElement.value;
+ console.log("CustomName function called with name value:", nameValue);
+ localStorage.setItem("CustomName", nameValue);
}
function ResetCustomCloak() {
- localStorage.removeItem("CustomName")
- localStorage.removeItem("CustomIcon")
- document.getElementById("icon").value = ""
- document.getElementById("name").value = ""
+ localStorage.removeItem("CustomName");
+ localStorage.removeItem("CustomIcon");
+ document.getElementById("icon").value = "";
+ document.getElementById("name").value = "";
}
function redirectToMainDomain() {
- var currentUrl = window.location.href
- var mainDomainUrl = currentUrl.replace(/\/[^\/]*$/, "")
+ var currentUrl = window.location.href;
+ var mainDomainUrl = currentUrl.replace(/\/[^\/]*$/, "");
if (window != top) {
- top.location.href = mainDomainUrl + window.location.pathname
+ top.location.href = mainDomainUrl + window.location.pathname;
} else {
- window.location.href = mainDomainUrl + window.location.pathname
+ window.location.href = mainDomainUrl + window.location.pathname;
}
}
document.addEventListener("DOMContentLoaded", function (event) {
- const icon = document.getElementById("tab-favicon")
- const name = document.getElementById("tab-title")
- var selectedValue = localStorage.getItem("selectedOption") || "Default"
- document.getElementById("dropdown").value = selectedValue
- updateHeadSection(selectedValue)
-})
+ const icon = document.getElementById("tab-favicon");
+ const name = document.getElementById("tab-title");
+ var selectedValue = localStorage.getItem("selectedOption") || "Default";
+ document.getElementById("dropdown").value = selectedValue;
+ updateHeadSection(selectedValue);
+});
function handleDropdownChange(selectElement) {
- var selectedValue = selectElement.value
- localStorage.removeItem("CustomName")
- localStorage.removeItem("CustomIcon")
- localStorage.setItem("selectedOption", selectedValue)
- updateHeadSection(selectedValue)
- redirectToMainDomain(selectedValue)
+ var selectedValue = selectElement.value;
+ localStorage.removeItem("CustomName");
+ localStorage.removeItem("CustomIcon");
+ localStorage.setItem("selectedOption", selectedValue);
+ updateHeadSection(selectedValue);
+ redirectToMainDomain(selectedValue);
}
function updateHeadSection(selectedValue) {
- const icon = document.getElementById("tab-favicon")
- const name = document.getElementById("tab-title")
- const customName = localStorage.getItem("CustomName")
- const customIcon = localStorage.getItem("CustomIcon")
+ const icon = document.getElementById("tab-favicon");
+ const name = document.getElementById("tab-title");
+ const customName = localStorage.getItem("CustomName");
+ const customIcon = localStorage.getItem("CustomIcon");
if (customName && customIcon) {
- name.textContent = customName
- icon.setAttribute("href", customIcon)
- localStorage.setItem("name", customName)
- localStorage.setItem("icon", customIcon)
+ name.textContent = customName;
+ icon.setAttribute("href", customIcon);
+ localStorage.setItem("name", customName);
+ localStorage.setItem("icon", customIcon);
}
}
// Background Image
document.addEventListener("DOMContentLoaded", function () {
- var saveButton = document.getElementById("save-button")
+ var saveButton = document.getElementById("save-button");
saveButton.addEventListener("click", function () {
- var backgroundInput = document.getElementById("background-input")
- var imageURL = backgroundInput.value
+ var backgroundInput = document.getElementById("background-input");
+ var imageURL = backgroundInput.value;
if (imageURL !== "") {
- localStorage.setItem("backgroundImage", imageURL)
- document.body.style.backgroundImage = "url('" + imageURL + "')"
- backgroundInput.value = ""
+ localStorage.setItem("backgroundImage", imageURL);
+ document.body.style.backgroundImage = "url('" + imageURL + "')";
+ backgroundInput.value = "";
} else {
}
- })
+ });
- var resetButton = document.getElementById("reset-button")
+ var resetButton = document.getElementById("reset-button");
resetButton.addEventListener("click", function () {
- localStorage.removeItem("backgroundImage")
- document.body.style.backgroundImage = "url('default-background.jpg')"
- })
+ localStorage.removeItem("backgroundImage");
+ document.body.style.backgroundImage = "url('default-background.jpg')";
+ });
- var savedBackgroundImage = localStorage.getItem("backgroundImage")
+ var savedBackgroundImage = localStorage.getItem("backgroundImage");
if (savedBackgroundImage) {
- document.body.style.backgroundImage = "url('" + savedBackgroundImage + "')"
+ document.body.style.backgroundImage = "url('" + savedBackgroundImage + "')";
}
-})
+});
// Particles
-const switches = document.getElementById("2")
+const switches = document.getElementById("2");
if (window.localStorage.getItem("Particles") != "") {
if (window.localStorage.getItem("Particles") == "true") {
- switches.checked = true
+ switches.checked = true;
} else {
- switches.checked = false
+ switches.checked = false;
}
}
switches.addEventListener("change", (event) => {
if (event.currentTarget.checked) {
- window.localStorage.setItem("Particles", "true")
+ window.localStorage.setItem("Particles", "true");
} else {
- window.localStorage.setItem("Particles", "false")
+ window.localStorage.setItem("Particles", "false");
}
-})
+});
// Themes
-var themeId = localStorage.getItem("theme")
+let themeId = localStorage.getItem("theme");
if (themeId == "") {
- themeId = "d"
+ themeId = "d";
}
-document.getElementsByClassName("td")[0].value = themeId
+document.getElementsByClassName("td")[0].value = themeId;
-const themeDropdown = document.getElementsByClassName("td")
-dropdown.addEventListener("change", function () {
- const selectedValue = dropdown.value
+const themeDropdown = document.getElementsByClassName("td")[0];
+themeDropdown.addEventListener("change", function () {
+ const selectedValue = themeDropdown.value;
- localStorage.setItem("theme", selectedValue)
+ localStorage.setItem("theme", selectedValue);
- window.location = window.location
-})
+ window.location = window.location;
+});
function themeChange(ele) {
- const selTheme = ele.value
+ const selTheme = ele.value;
- localStorage.setItem("theme", selTheme)
+ localStorage.setItem("theme", selTheme);
- window.location = window.location
+ window.location = window.location;
}
// AB Cloak
function AB() {
- let inFrame
+ let inFrame;
try {
- inFrame = window !== top
+ inFrame = window !== top;
} catch (e) {
- inFrame = true
+ inFrame = true;
}
if (!inFrame && !navigator.userAgent.includes("Firefox")) {
- const popup = open("about:blank", "_blank")
+ const popup = open("about:blank", "_blank");
if (!popup || popup.closed) {
- alert("Please allow popups and redirects.")
+ alert("Please allow popups and redirects.");
} else {
- const doc = popup.document
- const iframe = doc.createElement("iframe")
- const style = iframe.style
- const link = doc.createElement("link")
-
- const name = localStorage.getItem("name") || "My Drive - Google Drive"
- const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"
-
- doc.title = name
- link.rel = "icon"
- link.href = icon
-
- iframe.src = location.href
- style.position = "fixed"
- style.top = style.bottom = style.left = style.right = 0
- style.border = style.outline = "none"
- style.width = style.height = "100%"
-
- doc.head.appendChild(link)
- doc.body.appendChild(iframe)
-
- const pLink = localStorage.getItem(encodeURI("pLink")) || "https://www.nasa.gov/"
- location.replace(pLink)
-
- const script = doc.createElement("script")
+ const doc = popup.document;
+ const iframe = doc.createElement("iframe");
+ const style = iframe.style;
+ const link = doc.createElement("link");
+
+ const name = localStorage.getItem("name") || "My Drive - Google Drive";
+ const icon =
+ localStorage.getItem("icon") ||
+ "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png";
+
+ doc.title = name;
+ link.rel = "icon";
+ link.href = icon;
+
+ iframe.src = location.href;
+ style.position = "fixed";
+ style.top = style.bottom = style.left = style.right = 0;
+ style.border = style.outline = "none";
+ style.width = style.height = "100%";
+
+ doc.head.appendChild(link);
+ doc.body.appendChild(iframe);
+
+ const pLink =
+ localStorage.getItem(encodeURI("pLink")) || "https://www.nasa.gov/";
+ location.replace(pLink);
+
+ const script = doc.createElement("script");
script.textContent = `
window.onbeforeunload = function (event) {
const confirmationMessage = 'Leave Site?';
(event || window.event).returnValue = confirmationMessage;
return confirmationMessage;
};
- `
- doc.head.appendChild(script)
+ `;
+ doc.head.appendChild(script);
}
}
}
function toggleAB() {
- ab = localStorage.getItem("ab")
+ ab = localStorage.getItem("ab");
if (ab == null) {
- localStorage.setItem("ab", "false")
+ localStorage.setItem("ab", "false");
} else if (ab == "true") {
- localStorage.setItem("ab", "false")
+ localStorage.setItem("ab", "false");
} else {
- localStorage.setItem("ab", "true")
+ localStorage.setItem("ab", "true");
}
}
// Search Engine
function EngineChange(dropdown) {
- var selectedEngine = dropdown.value
+ var selectedEngine = dropdown.value;
var engineUrls = {
Google: "https://www.google.com/search?q=",
@@ -335,28 +327,28 @@ function EngineChange(dropdown) {
Startpage: "https://www.startpage.com/search?q=",
SearchEncrypt: "https://www.searchencrypt.com/search/?q=",
Ecosia: "https://www.ecosia.org/search?q=",
- }
+ };
- localStorage.setItem("engine", engineUrls[selectedEngine])
- localStorage.setItem("enginename", selectedEngine)
+ localStorage.setItem("engine", engineUrls[selectedEngine]);
+ localStorage.setItem("enginename", selectedEngine);
- dropdown.value = selectedEngine
+ dropdown.value = selectedEngine;
}
function SaveEngine() {
- var customEngine = document.getElementById("engine-form").value
+ var customEngine = document.getElementById("engine-form").value;
if (customEngine.trim() !== "") {
- localStorage.setItem("engine", customEngine)
- localStorage.setItem("enginename", "Custom")
+ localStorage.setItem("engine", customEngine);
+ localStorage.setItem("enginename", "Custom");
} else {
- alert("Please enter a custom search engine value.")
+ alert("Please enter a custom search engine value.");
}
}
document.addEventListener("DOMContentLoaded", function () {
- var selectedEngineName = localStorage.getItem("enginename")
- var dropdown = document.getElementById("engine")
+ var selectedEngineName = localStorage.getItem("enginename");
+ var dropdown = document.getElementById("engine");
if (selectedEngineName) {
- dropdown.value = selectedEngineName
+ dropdown.value = selectedEngineName;
}
-})
\ No newline at end of file
+});
diff --git a/static/games.html b/static/games.html
index 1913ad7f..b0548770 100644
--- a/static/games.html
+++ b/static/games.html
@@ -41,7 +41,7 @@
crossorigin="anonymous"
>
-
+