forked from gn-math/gn-math-DONTDMCA
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
731 lines (674 loc) · 31.1 KB
/
script.js
File metadata and controls
731 lines (674 loc) · 31.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
const container = document.getElementById('container');
const zoneViewer = document.getElementById('zoneViewer');
let zoneFrame = document.getElementById('zoneFrame');
const searchBar = document.getElementById('searchBar');
const sortOptions = document.getElementById('sortOptions');
const filterOptions = document.getElementById('filterOptions');
// https://www.jsdelivr.com/tools/purge
const zonesurls = [
"https://cdn.jsdelivr.net/%67%68/%67%6e%2d%6d%61%74%68/%61%73%73%65%74%73@%6d%61%69%6e/%7a%6f%6e%65%73%2e%6a%73%6f%6e",
"https://cdn.jsdelivr.net/gh/gn-math/assets@latest/zones.json",
"https://cdn.jsdelivr.net/gh/gn-math/assets@master/zones.json",
"https://cdn.jsdelivr.net/gh/gn-math/assets/zones.json"
];
let zonesURL = zonesurls[Math.floor(Math.random() * zonesurls.length)];
const coverURL = "https://cdn.jsdelivr.net/gh/gn-math/covers@main";
const htmlURL = "https://cdn.jsdelivr.net/gh/gn-math/html@main";
let zones = [];
let popularityData = {};
const featuredContainer = document.getElementById('featuredZones');
function toTitleCase(str) {
return str.replace(
/\w\S*/g,
text => text.charAt(0).toUpperCase() + text.substring(1).toLowerCase()
);
}
async function listZones() {
try {
let sharesponse;
let shajson;
let sha;
try {
sharesponse = await fetch("https://api.github.com/repos/gn-math/assets/commits?t="+Date.now());
} catch (error) {}
if (sharesponse && sharesponse.status === 200) {
try {
shajson = await sharesponse.json();
sha = shajson[0]['sha'];
if (sha) {
zonesURL = `https://cdn.jsdelivr.net/gh/gn-math/assets@${sha}/zones.json`;
}
} catch (error) {
try {
let secondarysharesponse = await fetch("https://raw.githubusercontent.com/gn-math/xml/refs/heads/main/sha.txt?t="+Date.now());
if (secondarysharesponse && secondarysharesponse.status === 200) {
sha = (await secondarysharesponse.text()).trim();
if (sha) {
zonesURL = `https://cdn.jsdelivr.net/gh/gn-math/assets@${sha}/zones.json`;
}
}
} catch(error) {}
}
}
const response = await fetch(zonesURL+"?t="+Date.now());
const json = await response.json();
zones = json;
zones[0].featured = true; // always gonna be the discord
await fetchPopularity();
sortZones();
const search = new URLSearchParams(window.location.search);
const id = search.get('id');
const embed = window.location.hash.includes("embed");
if (id) {
const zone = zones.find(zone => zone.id + '' == id + '');
if (zone) {
if (embed) {
if (zone.url.startsWith("http")) {
window.open(zone.url, "_blank");
} else {
const url = zone.url.replace("{COVER_URL}", coverURL).replace("{HTML_URL}", htmlURL);
fetch(url+"?t="+Date.now()).then(response => response.text()).then(html => {
document.documentElement.innerHTML = html;
const popup = document.createElement("div");
popup.style.position = "fixed";
popup.style.bottom = "20px";
popup.style.right = "20px";
popup.style.backgroundColor = "#cce5ff";
popup.style.color = "#004085";
popup.style.padding = "10px";
popup.style.border = "1px solid #b8daff";
popup.style.borderRadius = "5px";
popup.style.boxShadow = "0px 0px 10px rgba(0,0,0,0.1)";
popup.style.fontFamily = "Arial, sans-serif";
popup.innerHTML = `Play more games at <a href="Sites.google.com/view/jcunblockedio" target="_blank" style="color:#004085; font-weight:bold;">sites.google.com/view/jcunblockedio</a>!`;
const closeBtn = document.createElement("button");
closeBtn.innerText = "?";
closeBtn.style.marginLeft = "10px";
closeBtn.style.background = "none";
closeBtn.style.border = "none";
closeBtn.style.cursor = "pointer";
closeBtn.style.color = "#004085";
closeBtn.style.fontWeight = "bold";
closeBtn.onclick = () => popup.remove();
popup.appendChild(closeBtn);
document.body.appendChild(popup);
document.documentElement.querySelectorAll('script').forEach(oldScript => {
const newScript = document.createElement('script');
if (oldScript.src) {
newScript.src = oldScript.src;
} else {
newScript.textContent = oldScript.textContent;
}
document.body.appendChild(newScript);
});
}).catch(error => alert("Failed to load zone: " + error));
}
} else {
openZone(zone);
}
}
}
let alltags = [];
for (const obj of json) {
if (Array.isArray(obj.special)) {
alltags.push(...obj.special);
}
}
alltags = [...new Set(alltags)];
let filteroption = document.getElementById("filterOptions");
if (filteroption && filteroption.children.length > 1) {
while (filteroption.children.length > 1) {
filteroption.removeChild(filteroption.lastElementChild);
}
}
for (const tag of alltags) {
const opt = document.createElement("option");
opt.value = tag;
opt.textContent = toTitleCase(tag);
filteroption.appendChild(opt);
}
} catch (error) {
console.error(error);
container.innerHTML = `Error loading zones: ${error}`;
}
}
async function fetchPopularity() {
try {
const response = await fetch("https://data.jsdelivr.com/v1/stats/packages/gh/gn-math/html@main/files?period=year");
const data = await response.json();
data.forEach(file => {
const idMatch = file.name.match(/\/(\d+)\.html$/);
if (idMatch) {
const id = parseInt(idMatch[1]);
popularityData[id] = file.hits.total;
}
});
} catch (error) {
popularityData[0] = 0;
}
}
function sortZones() {
const sortBy = sortOptions.value;
if (sortBy === 'name') {
zones.sort((a, b) => a.name.localeCompare(b.name));
} else if (sortBy === 'id') {
zones.sort((a, b) => a.id - b.id);
} else if (sortBy === 'popular') {
zones.sort((a, b) => (popularityData[b.id] || 0) - (popularityData[a.id] || 0));
}
zones.sort((a, b) => (a.id === -1 ? -1 : b.id === -1 ? 1 : 0));
if (featuredContainer.innerHTML === "") {
const featured = zones.filter(z => z.featured);
displayFeaturedZones(featured);
}
displayZones(zones);
}
function displayFeaturedZones(featuredZones) {
featuredContainer.innerHTML = "";
featuredZones.forEach((file, index) => {
const zoneItem = document.createElement("div");
zoneItem.className = "zone-item";
zoneItem.onclick = () => openZone(file);
const img = document.createElement("img");
img.dataset.src = file.cover.replace("{COVER_URL}", coverURL).replace("{HTML_URL}", htmlURL);
img.alt = file.name;
img.loading = "lazy";
img.className = "lazy-zone-img";
zoneItem.appendChild(img);
const button = document.createElement("button");
button.textContent = file.name;
button.onclick = (event) => {
event.stopPropagation();
openZone(file);
};
zoneItem.appendChild(button);
featuredContainer.appendChild(zoneItem);
});
if (featuredContainer.innerHTML === "") {
featuredContainer.innerHTML = "No featured zones found.";
} else {
document.getElementById("allZonesSummary").textContent = `Featured Zones (${featuredZones.length})`;
}
const lazyImages = document.querySelectorAll('#featuredZones img.lazy-zone-img');
const imageObserver = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting && !zoneViewer.hidden) {
const img = entry.target;
img.src = img.dataset.src;
img.classList.remove("lazy-zone-img");
observer.unobserve(img);
}
});
}, {
rootMargin: "100px",
threshold: 0.1
});
lazyImages.forEach(img => {
imageObserver.observe(img);
});
}
function displayZones(zones) {
container.innerHTML = "";
zones.forEach((file, index) => {
const zoneItem = document.createElement("div");
zoneItem.className = "zone-item";
zoneItem.onclick = () => openZone(file);
const img = document.createElement("img");
img.dataset.src = file.cover.replace("{COVER_URL}", coverURL).replace("{HTML_URL}", htmlURL);
img.alt = file.name;
img.loading = "lazy";
img.className = "lazy-zone-img";
zoneItem.appendChild(img);
const button = document.createElement("button");
button.textContent = file.name;
button.onclick = (event) => {
event.stopPropagation();
openZone(file);
};
zoneItem.appendChild(button);
container.appendChild(zoneItem);
});
if (container.innerHTML === "") {
container.innerHTML = "No zones found.";
} else {
document.getElementById("allSummary").textContent = `All Zones (${zones.length})`;
}
const lazyImages = document.querySelectorAll('img.lazy-zone-img');
const imageObserver = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting && !zoneViewer.hidden) {
const img = entry.target;
img.src = img.dataset.src;
img.classList.remove("lazy-zone-img");
observer.unobserve(img);
}
});
}, {
rootMargin: "100px",
threshold: 0.1
});
lazyImages.forEach(img => {
imageObserver.observe(img);
});
}
function filterZones2() {
const query = filterOptions.value;
if (query === "none") {
displayZones(zones);
} else {
const filteredZones = zones.filter(zone => zone.special?.includes(query));
if (query.length !== 0) {
document.getElementById("featuredZonesWrapper").removeAttribute("open");
}
displayZones(filteredZones);
}
}
function filterZones() {
const query = searchBar.value.toLowerCase();
const filteredZones = zones.filter(zone => zone.name.toLowerCase().includes(query));
if (query.length !== 0) {
document.getElementById("featuredZonesWrapper").removeAttribute("open");
}
displayZones(filteredZones);
}
function openZone(file) {
if (file.url.startsWith("http")) {
window.open(file.url, "_blank");
} else {
const url = file.url.replace("{COVER_URL}", coverURL).replace("{HTML_URL}", htmlURL);
fetch(url+"?t="+Date.now()).then(response => response.text()).then(html => {
if (zoneFrame.contentDocument === null) {
zoneFrame = document.createElement("iframe");
zoneFrame.id = "zoneFrame";
zoneViewer.appendChild(zoneFrame);
}
zoneFrame.contentDocument.open();
zoneFrame.contentDocument.write(html);
zoneFrame.contentDocument.close();
document.getElementById('zoneName').textContent = file.name;
document.getElementById('zoneId').textContent = file.id;
document.getElementById('zoneAuthor').textContent = "by " + file.author;
if (file.authorLink) {
document.getElementById('zoneAuthor').href = file.authorLink;
}
zoneViewer.style.display = "block";
const url = new URL(window.location);
url.searchParams.set('id', file.id);
history.pushState(null, '', url.toString());
zoneViewer.hidden = true;
}).catch(error => alert("Failed to load zone: " + error));
}
}
function aboutBlank() {
const newWindow = window.open("about:blank", "_blank");
let zone = zones.find(zone => zone.id + '' === document.getElementById('zoneId').textContent).url.replace("{COVER_URL}", coverURL).replace("{HTML_URL}", htmlURL);
fetch(zone+"?t="+Date.now()).then(response => response.text()).then(html => {
if (newWindow) {
newWindow.document.open();
newWindow.document.write(html);
newWindow.document.close();
}
})
}
function closeZone() {
zoneViewer.hidden = false;
zoneViewer.style.display = "none";
zoneViewer.removeChild(zoneFrame);
const url = new URL(window.location);
url.searchParams.delete('id');
history.pushState(null, '', url.toString());
}
function downloadZone() {
let zone = zones.find(zone => zone.id + '' === document.getElementById('zoneId').textContent);
fetch(zone.url.replace("{HTML_URL}", htmlURL)+"?t="+Date.now()).then(res => res.text()).then(text => {
const blob = new Blob([text], {
type: "text/plain;charset=utf-8"
});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = zone.name + ".html";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
});
}
function fullscreenZone() {
if (zoneFrame.requestFullscreen) {
zoneFrame.requestFullscreen();
} else if (zoneFrame.mozRequestFullScreen) {
zoneFrame.mozRequestFullScreen();
} else if (zoneFrame.webkitRequestFullscreen) {
zoneFrame.webkitRequestFullscreen();
} else if (zoneFrame.msRequestFullscreen) {
zoneFrame.msRequestFullscreen();
}
}
function sanitizeData(obj, maxStringLen = 1000, maxArrayLen = 10000) {
if (typeof obj === 'string') {
return obj.length > maxStringLen ? obj.slice(0, maxStringLen) + '...[truncated]' : obj;
}
if (obj instanceof Uint8Array) {
if (obj.length > maxArrayLen) {
return `[Uint8Array too large (${obj.length} bytes), truncated]`;
}
return obj;
}
if (Array.isArray(obj)) {
return obj.map(item => sanitizeData(item, maxStringLen, maxArrayLen));
}
if (obj && typeof obj === 'object') {
const newObj = {};
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
newObj[key] = sanitizeData(obj[key], maxStringLen, maxArrayLen);
}
}
return newObj;
}
return obj;
}
async function saveData() {
alert("This might take a while, dont touch anything other than this OK button");
const result = {};
result.cookies = document.cookie;
result.localStorage = {...localStorage};
result.sessionStorage = {...sessionStorage};
result.indexedDB = {};
const dbs = await indexedDB.databases();
for (const dbInfo of dbs) {
if (!dbInfo.name) continue;
result.indexedDB[dbInfo.name] = {};
await new Promise((resolve, reject) => {
const openRequest = indexedDB.open(dbInfo.name, dbInfo.version);
openRequest.onerror = () => reject(openRequest.error);
openRequest.onsuccess = () => {
const db = openRequest.result;
const storeNames = Array.from(db.objectStoreNames);
if (storeNames.length === 0) {
resolve();
return;
}
const transaction = db.transaction(storeNames, "readonly");
const storePromises = [];
for (const storeName of storeNames) {
result.indexedDB[dbInfo.name][storeName] = [];
const store = transaction.objectStore(storeName);
const getAllRequest = store.getAll();
const p = new Promise((res, rej) => {
getAllRequest.onsuccess = () => {
result.indexedDB[dbInfo.name][storeName] = sanitizeData(getAllRequest.result, 1000, 100);
res();
};
getAllRequest.onerror = () => rej(getAllRequest.error);
});
storePromises.push(p);
}
Promise.all(storePromises).then(() => resolve());
};
});
}
result.caches = {};
const cacheNames = await caches.keys();
for (const cacheName of cacheNames) {
const cache = await caches.open(cacheName);
const requests = await cache.keys();
result.caches[cacheName] = [];
for (const req of requests) {
const response = await cache.match(req);
if (!response) continue;
const cloned = response.clone();
const contentType = cloned.headers.get('content-type') || '';
let body;
try {
if (contentType.includes('application/json')) {
body = await cloned.json();
} else if (contentType.includes('text') || contentType.includes('javascript')) {
body = await cloned.text();
} else {
const buffer = await cloned.arrayBuffer();
body = btoa(String.fromCharCode(...new Uint8Array(buffer)));
}
} catch (e) {
body = '[Unable to read body]';
}
result.caches[cacheName].push({
url: req.url,
body,
contentType
});
}
}
alert("Done, wait for the download to come");
const link = document.createElement("a");
link.href = URL.createObjectURL(new Blob([JSON.stringify(result)], {
type: "application/octet-stream"
}));
link.download = `${Date.now()}.data`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
async function loadData(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = async function (e) {
const data = JSON.parse(e.target.result);
if (data.cookies) {
data.cookies.split(';').forEach(cookie => {
document.cookie = cookie.trim();
});
}
if (data.localStorage) {
for (const key in data.localStorage) {
localStorage.setItem(key, data.localStorage[key]);
}
}
if (data.sessionStorage) {
for (const key in data.sessionStorage) {
sessionStorage.setItem(key, data.sessionStorage[key]);
}
}
if (data.indexedDB) {
for (const dbName in data.indexedDB) {
const stores = data.indexedDB[dbName];
await new Promise((resolve, reject) => {
const request = indexedDB.open(dbName, 1);
request.onupgradeneeded = e => {
const db = e.target.result;
for (const storeName in stores) {
if (!db.objectStoreNames.contains(storeName)) {
db.createObjectStore(storeName, { keyPath: 'id', autoIncrement: true });
}
}
};
request.onsuccess = e => {
const db = e.target.result;
const transaction = db.transaction(Object.keys(stores), 'readwrite');
transaction.onerror = () => reject(transaction.error);
let pendingStores = Object.keys(stores).length;
for (const storeName in stores) {
const objectStore = transaction.objectStore(storeName);
objectStore.clear().onsuccess = () => {
for (const item of stores[storeName]) {
objectStore.put(item);
}
pendingStores--;
if (pendingStores === 0) resolve();
};
}
};
request.onerror = () => reject(request.error);
});
}
}
if (data.caches) {
for (const cacheName in data.caches) {
const cache = await caches.open(cacheName);
await cache.keys().then(keys => Promise.all(keys.map(k => cache.delete(k)))); // clear existing
for (const entry of data.caches[cacheName]) {
let responseBody;
if (entry.contentType.includes('application/json')) {
responseBody = JSON.stringify(entry.body);
} else if (entry.contentType.includes('text') || entry.contentType.includes('javascript')) {
responseBody = entry.body;
} else {
const binaryStr = atob(entry.body);
const len = binaryStr.length;
const bytes = new Uint8Array(len);
for (let i = 0; i < len; i++) {
bytes[i] = binaryStr.charCodeAt(i);
}
responseBody = bytes.buffer;
}
const headers = new Headers({ 'content-type': entry.contentType });
const response = new Response(responseBody, { headers });
await cache.put(entry.url, response);
}
}
}
alert("Data loaded");
};
alert("This might take a while, dont touch anything other than this OK button");
reader.readAsText(file);
}
function darkMode() {
document.body.classList.toggle("dark-mode");
}
function cloakIcon(url) {
const link = document.querySelector("link[rel~='icon']");
link.rel = "icon";
if ((url+"").trim().length === 0) {
link.href = "Icon.png";
} else {
link.href = url;
}
document.head.appendChild(link);
}
function cloakName(string) {
if ((string+"").trim().length === 0) {
document.title = "JC Unblocked";
return;
}
document.title = string;
}
function tabCloak() {
closePopup();
document.getElementById('popupTitle').textContent = "Tab Cloak";
const popupBody = document.getElementById('popupBody');
popupBody.innerHTML = `
<label for="tab-cloak-textbox" style="font-weight: bold;">Set Tab Title:</label><br>
<input type="text" id="tab-cloak-textbox" placeholder="Enter new tab name..." oninput="cloakName(this.value)">
<br><br><br><br>
<label for="tab-cloak-textbox" style="font-weight: bold;">Set Tab Icon:</label><br>
<input type="text" id="tab-cloak-textbox" placeholder="Enter new tab icon..." oninput='cloakIcon(this.value)'>
<br><br><br>
`;
popupBody.contentEditable = false;
document.getElementById('popupOverlay').style.display = "flex";
}
const settings = document.getElementById('settings');
settings.addEventListener('click', () => {
document.getElementById('popupTitle').textContent = "Settings";
const popupBody = document.getElementById('popupBody');
popupBody.innerHTML = `
<button class="settings-button" onclick="darkMode()">Toggle Dark Mode</button>
<br><br>
<button class="settings-button" onclick="tabCloak()">Tab Cloak</button>
<br>
`;
popupBody.contentEditable = false;
document.getElementById('popupOverlay').style.display = "flex";
});
function showContact() {
document.getElementById('popupTitle').textContent = "Contact";
const popupBody = document.getElementById('popupBody');
popupBody.innerHTML = `
<p>Discord: https://discord.gg/aEfAs6Br</p>
<p>Email: Familylanzcreations@gmail.com</p>`;
popupBody.contentEditable = false;
document.getElementById('popupOverlay').style.display = "flex";
}
function loadPrivacy() {
document.getElementById('popupTitle').textContent = "Privacy Policy";
const popupBody = document.getElementById('popupBody');
popupBody.innerHTML = `
<div style="max-height: 60vh; overflow-y: auto;">
<h2>PRIVACY POLICY</h2>
<p>This Privacy Notice for JC Unblocked ("we," "us," or "our"), describes how and why we might access, collect, store, use, and/or share ("process") your personal information when you use our services ("Services"), including when you:</p>
<ul>
<li>Visit our website at <a href="sites.google.com/view/jcunblockedio">sites.google.com/view/jcunblockedio</a>, or any website of ours that links to this Privacy Notice</li>
<li>Engage with us in other related ways, including any sales, marketing, or events</li>
</ul>
<p>Questions or concerns? Reading this Privacy Notice will help you understand your privacy rights and choices. We are responsible for making decisions about how your personal information is processed. If you do not agree with our policies and practices, please do not use our Services. If you still have any questions or concerns, please contact us at <a href="https://discord.gg/NAFw4ykZ7n">https://discord.gg/NAFw4ykZ7n</a>.</p>
<h3>SUMMARY OF KEY POINTS</h3>
<p>This summary provides key points from our Privacy Notice, but you can find out more details about any of these topics by clicking the link following each key point or by using our table of contents below to find the section you are looking for.</p>
<p><strong>What personal information do we process?</strong> When you visit, use, or navigate our Services, we may process personal information depending on how you interact with us and the Services, the choices you make, and the products and features you use. Learn more about personal information you disclose to us.</p>
<p><strong>Do we process any sensitive personal information?</strong> Some of the information may be considered "special" or "sensitive" in certain jurisdictions, for example your racial or ethnic origins, sexual orientation, and religious beliefs. We do not process sensitive personal information.</p>
<p><strong>Do we collect any information from third parties?</strong> We do not collect any information from third parties.</p>
<p><strong>How do we process your information?</strong> We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent. We process your information only when we have a valid legal reason to do so. Learn more about how we process your information.</p>
<p><strong>In what situations and with which parties do we share personal information?</strong> We may share information in specific situations and with specific third parties. Learn more about when and with whom we share your personal information.</p>
<p><strong>How do we keep your information safe?</strong> We have adequate organizational and technical processes and procedures in place to protect your personal information. However, no electronic transmission over the internet or information storage technology can be guaranteed to be 100% secure, so we cannot promise or guarantee that hackers, cybercriminals, or other unauthorized third parties will not be able to defeat our security and improperly collect, access, steal, or modify your information. Learn more about how we keep your information safe.</p>
<p><strong>What are your rights?</strong> Depending on where you are located geographically, the applicable privacy law may mean you have certain rights regarding your personal information. Learn more about your privacy rights.</p>
<p><strong>How do you exercise your rights?</strong> The easiest way to exercise your rights is by submitting a data subject access request, or by contacting us. We will consider and act upon any request in accordance with applicable data protection laws.</p>
</div>
`;
popupBody.contentEditable = false;
document.getElementById('popupOverlay').style.display = "flex";
}
function loadDMCA() {
document.getElementById('popupTitle').textContent = "DMCA";
const popupBody = document.getElementById('popupBody');
popupBody.innerHTML = `
<div class="dmca-content">
<p>
If you own or developed a game that is on <strong>JC Unblocked</strong>
and would like it removed, please do one of the following:
</p>
<ol>
<li>
<a href="https://discord.gg/aEfAs6Br" target="_blank" rel="noopener noreferrer">
Join the Discord
</a> and DM <strong>breadbb</strong> or ping me in a public channel
<strong>[INSTANT RESPONSE]</strong>
</li>
<li>
</li>
</ol>
<p>
</p>
</div>
`;
popupBody.contentEditable = false;
document.getElementById('popupOverlay').style.display = "flex";
}
function closePopup() {
document.getElementById('popupOverlay').style.display = "none";
}
listZones();
const schoolList = ["deledao", "goguardian", "lightspeed", "linewize", "securly", ".edu/"];
function isBlockedDomain(url) {
const domain = new URL(url, location.origin).hostname + "/";
return schoolList.some(school => domain.includes(school));
}
const originalFetch = window.fetch;
window.fetch = function (url, options) {
if (isBlockedDomain(url)) {
console.warn(`lam`);
return Promise.reject(new Error("lam"));
}
return originalFetch.apply(this, arguments);
};
const originalOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function (method, url) {
if (isBlockedDomain(url)) {
console.warn(`lam`);
return;
}
return originalOpen.apply(this, arguments);
};
HTMLCanvasElement.prototype.toDataURL = function (...args) {
return "";
};