Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Degen-dev
GitHub Repository: Degen-dev/Degeneracy
Path: blob/master/public/scripts/main.js
3950 views
1
let
2
main = document.querySelector("main") || {},
3
form = document.querySelector("form") || {},
4
input = !form=={} ? form.querySelector("input") : {},
5
title = localStorage.getItem("title"),
6
icon = localStorage.getItem("icon"),
7
pageicon = document.getElementById("pageicon"),
8
iframe_frame = document.getElementById("iframe_frame"),
9
titlechange = document.getElementById("tabtitle"),
10
descFrame = document.getElementById("descFrame");
11
12
// Description Iframes
13
14
function descClear() {
15
descFrame.setAttribute("src", "/select#d")
16
}
17
18
function corDesc() {
19
descFrame.setAttribute("src", "/select#c")
20
}
21
22
function womDesc() {
23
descFrame.setAttribute("src", "/select#w")
24
}
25
26
function pyDesc() {
27
descFrame.setAttribute("src", "/select#p")
28
}
29
30
//Stealth Mode JS
31
32
function stealth() {
33
iframe_frame.style.display = "initial";
34
main.style.display = "none";
35
iframe_frame.setAttribute("src", "/go/gateway?url=" + input.value);
36
};
37
38
function womStealth() {
39
iframe_frame.style.display = "initial";
40
main.style.display = "none";
41
var url = document.getElementById("womurl").value;
42
if (url.includes(".")) {
43
iframe_frame.setAttribute("src", "https://w." + document.domain + "/main/" + url);
44
} else {
45
iframe_frame.setAttribute("src", "https://w." + document.domain + "/main/" + "https://searx.degenerate.info/search?q=" + url.replace(/ /g, "+"));
46
}
47
};
48
49
function pyStealth() {
50
iframe_frame.style.display = "initial";
51
main.style.display = "none";
52
var url = document.getElementById("pruorl").value;
53
if (url.includes(".")) {
54
iframe_frame.setAttribute("src", "/service/gateway?url=" + url);
55
} else {
56
iframe_frame.setAttribute("src", "/service/gateway?url=https://searx.degenerate.info/search?q=" + url.replace(/ /g, "+"));
57
}
58
};
59
60
//Tab Cloaking JS
61
function tabtitle() {
62
window.localStorage.setItem("title", titlechange.value);
63
window.document.title = titlechange.value;
64
};
65
66
if (window.localStorage.hasOwnProperty('title')) {
67
document.title = title;
68
};
69
70
//Tab Icon
71
function tabicon() {
72
document.head.querySelector("link[rel=icon]").href = titlechange.value;
73
window.localStorage.setItem("icon", titlechange.value);
74
loadPicture()
75
};
76
77
if (window.localStorage.hasOwnProperty("icon")) {
78
document.querySelector("link[rel=icon]").href = icon;
79
};
80
81
//Sets image to the tab icon
82
function loadPicture() {
83
if (window.localStorage.hasOwnProperty("icon")) {
84
pageicon.setAttribute("src", localStorage.getItem("icon"));
85
} else {
86
pageicon.setAttribute("src", "/images/Degener.png");
87
};
88
};
89
90
//Clears Tab Icon and Title
91
function resetTab() {
92
let items = ["icon", "title"];
93
94
items.forEach(item =>
95
localStorage.removeItem(item));
96
window.location.reload();
97
pageicon();
98
};
99
100
101