Skip to content

Commit afb443e

Browse files
committed
V5.2 - Merged Tabs & Proxy Page + Formatted + Fixed Dynamic
1 parent 92e9290 commit afb443e

File tree

25 files changed

+598
-848
lines changed

25 files changed

+598
-848
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ As of January 1st, 2024, Replit is [no longer free](https://blog.replit.com/host
6262
2. Click "Code" (green button) and then "Create Codespace on main."
6363
3. In the terminal at the bottom, paste `pnpm i && pnpm start`.
6464
4. Respond to the application popup by clicking "Make public."
65-
> [!IMPORTANT]
66-
> Make sure you click the "Make public." button, or the proxy won't function properly.
65+
> [!IMPORTANT]
66+
> Make sure you click the "Make public." button, or the proxy won't function properly.
6767
5. Access the deployed website from the ports tab.
6868
6. For subsequent uses in the same codespace, just run `pnpm start`
6969

index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ app.use(express.static(path.join(__dirname, "static")))
3131

3232
if (config.routes !== false) {
3333
const routes = [
34-
{ path: "/ap", file: "apps.html" },
35-
{ path: "/g", file: "games.html" },
36-
{ path: "/s", file: "settings.html" },
37-
{ path: "/t", file: "tabs.html" },
38-
{ path: "/p", file: "go.html" },
34+
{ path: "/as", file: "apps.html" },
35+
{ path: "/gm", file: "games.html" },
36+
{ path: "/st", file: "settings.html" },
37+
{ path: "/ta", file: "tabs.html" },
3938
{ path: "/", file: "index.html" },
4039
{ path: "/tos", file: "tos.html" },
4140
]

static/apps.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<script src="./m/config.js?v=5"></script>
1212
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1313
<link rel="stylesheet" href="/assets/styles/main.css?v=8" />
14-
<link rel="stylesheet" href="/assets/styles/themes/default.css?v=5" />
15-
<script src="/assets/scripts/main.js?v=38"></script>
16-
<script src="/assets/scripts/index.js?v=14"></script>
14+
<link rel="stylesheet" href="/assets/styles/global.css?v=8" />
15+
<script src="/assets/scripts/m.js?v=42"></script>
16+
<script src="/assets/scripts/i.js?v=18"></script>
1717
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
18-
<script src="assets/scripts/a.js?v=50"></script>
18+
<script src="assets/scripts/a.js?v=52"></script>
1919
</head>
2020
<body>
2121
<div class="fixed-nav-bar"></div>
@@ -38,7 +38,7 @@
3838
</div>
3939
<div class="pinned-apps"></div>
4040
<div class="container-apps"></div>
41-
<script src="/assets/scripts/main.js?v=38"></script>
41+
<script src="/assets/scripts/m.js?v=42"></script>
4242
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WKJQ5QHQTJ"></script>
4343
<!-- DO NOT REMOVE-->
4444
<script>

static/assets/scripts/a.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function handleClick(app) {
1111

1212
if (app.local) {
1313
saveToLocal(app.link)
14-
window.location.href = "p"
14+
window.location.href = "ta"
1515
} else if (app.local2) {
1616
saveToLocal(app.link)
1717
window.location.href = app.link

static/assets/scripts/fr.js

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
const iframe = document.getElementById("iframe-container")
2+
3+
if (navigator.userAgent.includes("Chrome")) {
4+
window.addEventListener("resize", function () {
5+
navigator.keyboard.lock(["Escape"])
6+
})
7+
}
8+
9+
// Decode URL
10+
function decodeXor(input) {
11+
if (!input) return input
12+
let [str, ...search] = input.split("?")
13+
14+
return (
15+
decodeURIComponent(str)
16+
.split("")
17+
.map((char, ind) => (ind % 2 ? String.fromCharCode(char.charCodeAt(NaN) ^ 2) : char))
18+
.join("") + (search.length ? "?" + search.join("?") : "")
19+
)
20+
}
21+
22+
// Button Variables
23+
const iframeContainer = document.getElementById("iframe-container")
24+
const iframes = Array.from(iframeContainer.querySelectorAll("iframe"))
25+
const activeIframe = document.querySelector("#iframe-container iframe.active")
26+
27+
function Load() {
28+
const activeIframe = document.querySelector("#iframe-container iframe.active")
29+
if (activeIframe && document.readyState === "complete") {
30+
const website = activeIframe.contentWindow.document.location.href
31+
32+
if (website.includes("/a/")) {
33+
const websitePath = website.replace(window.location.origin, "").replace("/a/", "")
34+
const decodedValue = decodeXor(websitePath)
35+
document.getElementById("is").value = decodedValue
36+
localStorage.setItem("decoded", decodedValue)
37+
} else if (website.includes("/a/q/")) {
38+
const websitePath = website.replace(window.location.origin, "").replace("/a/q/", "")
39+
const decodedValue = decodeXor(websitePath)
40+
document.getElementById("is").value = decodedValue
41+
localStorage.setItem("decoded", decodedValue)
42+
} else {
43+
const websitePath = website.replace(window.location.origin, "")
44+
document.getElementById("is").value = websitePath
45+
localStorage.setItem("decoded", websitePath)
46+
}
47+
}
48+
}
49+
50+
function OnLoad() {
51+
if (window.loaded) {
52+
console.log("OnLoad() function already executed. Exiting.")
53+
return
54+
}
55+
window.loaded = true
56+
57+
let GoUrl = sessionStorage.getItem("GoUrl")
58+
let dyValue = localStorage.getItem("dy")
59+
60+
if (!GoUrl) {
61+
return
62+
}
63+
64+
if (!GoUrl.startsWith("/e/")) {
65+
if (dyValue === "true" || dyValue === "auto") {
66+
GoUrl = "/a/q/" + GoUrl
67+
} else {
68+
GoUrl = "/a/" + GoUrl
69+
}
70+
} else {
71+
}
72+
console.log(GoUrl)
73+
74+
const activeIframe = document.querySelector("#iframe-container iframe.active")
75+
if (!activeIframe) {
76+
return
77+
}
78+
79+
activeIframe.removeAttribute("onload")
80+
81+
activeIframe.contentWindow.document.location.href = GoUrl
82+
setTimeout(Load, 1500)
83+
}
84+
85+
// Reload
86+
function reload() {
87+
const activeIframe = document.querySelector("#iframe-container iframe.active")
88+
if (activeIframe) {
89+
activeIframe.src = activeIframe.src
90+
Load()
91+
} else {
92+
console.error("No active iframe found")
93+
}
94+
}
95+
96+
// Popout
97+
function popout() {
98+
const activeIframe = document.querySelector("#iframe-container iframe.active")
99+
100+
if (activeIframe) {
101+
const newWindow = window.open("about:blank", "_blank")
102+
103+
if (newWindow) {
104+
const name = localStorage.getItem("name") || "My Drive - Google Drive"
105+
const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"
106+
107+
newWindow.document.title = name
108+
109+
const link = newWindow.document.createElement("link")
110+
link.rel = "icon"
111+
link.href = encodeURI(icon)
112+
newWindow.document.head.appendChild(link)
113+
114+
const newIframe = newWindow.document.createElement("iframe")
115+
const style = newIframe.style
116+
style.position = "fixed"
117+
style.top = style.bottom = style.left = style.right = 0
118+
style.border = style.outline = "none"
119+
style.width = style.height = "100%"
120+
121+
newIframe.src = activeIframe.src
122+
123+
newWindow.document.body.appendChild(newIframe)
124+
}
125+
} else {
126+
console.error("No active iframe found")
127+
}
128+
}
129+
130+
function erudaToggle() {
131+
const activeIframe = document.querySelector("#iframe-container iframe.active")
132+
if (!activeIframe) {
133+
console.error("No active iframe found")
134+
return
135+
}
136+
137+
const erudaWindow = activeIframe.contentWindow
138+
if (!erudaWindow) {
139+
console.error("No content window found for the active iframe")
140+
return
141+
}
142+
143+
if (erudaWindow.eruda) {
144+
if (erudaWindow.eruda._isInit) {
145+
erudaWindow.eruda.destroy()
146+
} else {
147+
console.error("Eruda is not initialized in the active iframe")
148+
}
149+
} else {
150+
const erudaDocument = activeIframe.contentDocument
151+
if (!erudaDocument) {
152+
console.error("No content document found for the active iframe")
153+
return
154+
}
155+
156+
const script = erudaDocument.createElement("script")
157+
script.src = "https://cdn.jsdelivr.net/npm/eruda"
158+
script.onload = function () {
159+
if (!erudaWindow.eruda) {
160+
console.error("Failed to load Eruda in the active iframe")
161+
return
162+
}
163+
erudaWindow.eruda.init()
164+
erudaWindow.eruda.show()
165+
}
166+
erudaDocument.head.appendChild(script)
167+
}
168+
}
169+
170+
// Fullscreen
171+
function FS() {
172+
const activeIframe = document.querySelector("#iframe-container iframe.active")
173+
if (activeIframe) {
174+
if (!activeIframe.contentDocument.fullscreenElement) {
175+
activeIframe.contentDocument.documentElement.requestFullscreen()
176+
} else {
177+
activeIframe.contentDocument.exitFullscreen()
178+
}
179+
} else {
180+
console.error("No active iframe found")
181+
}
182+
}
183+
184+
const fullscreenButton = document.getElementById("fullscreen-button")
185+
fullscreenButton.addEventListener("click", FS)
186+
187+
// Home
188+
function Home() {
189+
window.location.href = "./"
190+
}
191+
192+
const homeButton = document.getElementById("home-page")
193+
homeButton.addEventListener("click", Home)
194+
195+
// Back
196+
function goBack() {
197+
const activeIframe = document.querySelector("#iframe-container iframe.active")
198+
if (activeIframe) {
199+
activeIframe.contentWindow.history.back()
200+
iframe.src = activeIframe.src
201+
Load()
202+
} else {
203+
console.error("No active iframe found")
204+
}
205+
}
206+
207+
// Forward
208+
function goForward() {
209+
const activeIframe = document.querySelector("#iframe-container iframe.active")
210+
if (activeIframe) {
211+
activeIframe.contentWindow.history.forward()
212+
iframe.src = activeIframe.src
213+
Load()
214+
} else {
215+
console.error("No active iframe found")
216+
}
217+
}
218+
219+
// Remove Nav
220+
document.addEventListener("fullscreenchange", function () {
221+
const isFullscreen = Boolean(document.fullscreenElement)
222+
document.body.classList.toggle("fullscreen", isFullscreen)
223+
})

0 commit comments

Comments
 (0)