This repository was archived by the owner on Sep 15, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathsettings.html
More file actions
108 lines (103 loc) · 4.38 KB
/
Copy pathsettings.html
File metadata and controls
108 lines (103 loc) · 4.38 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Settings</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="styles.css" />
<style>
#games { display: flex; justify-content: center; }
#games main { text-align: center; width: 100%; max-width: 900px; margin: 0 auto; }
#games main > div { display: inline-block; text-align: center; }
</style>
</head>
<body>
<nav>
<button type="button" class="nav-btn" onclick="location.href='/start.html'">Home</button>
<button type="button" class="nav-btn" onclick="location.href='/select.html'">Games</button>
<button type="button" class="nav-btn" onclick="location.href='/tools.html'">Tools</button>
<button type="button" class="nav-btn" aria-current="page" onclick="location.href='/settings.html'">Settings</button>
<button type="button" class="nav-btn" onclick="location.href='/disclaimer.html'">Disclaimer</button>
</nav>
<div id="games">
<main>
<h1>Settings Options:</h1>
<div style="margin-top:2rem;">
<label for="tabCloaker" style="font-size:1.2em;font-weight:bold;display:block;margin-bottom:0.5em;">Tab Cloaker</label>
<select id="tabCloaker" style="font-size:1em;padding:0.5em;">
<option value="default">Default</option>
<option value="google">Google</option>
<option value="vocab">Vocabulary.com</option>
</select>
<div style="height:1.5em;"></div>
<label for="idk" style="font-size:1.2em;font-weight:bold;display:block;margin-bottom:0.5em;">Click to launch in about:blank if you aren't already:</label>
<button class="button" id="bg-launch-btn" onclick="openGame()" >Tab cloaker</button>
<script>
function openGame() {
var win = window.open();
var url = "start.html";
win.document.title = 'Wikipedia';
var link = win.document.createElement('link');
link.rel = 'icon';
link.type = 'image/x-icon';
link.href = 'https://en.wikipedia.org/favicon.ico';
win.document.head.appendChild(link);
var iframe = win.document.createElement('iframe');
iframe.style.width = "100%";
iframe.style.height = "100%";
iframe.style.border = "none";
iframe.src = url;
win.document.body.appendChild(iframe);
}
</script>
</div>
<div style="height:1.5em;"></div>
<script>
// Tab cloaker logic for settings page
const tabCloaker = document.getElementById('tabCloaker');
const favicon = document.querySelector("link[rel~='icon']") || (() => {
const link = document.createElement('link');
link.rel = 'icon';
document.head.appendChild(link);
return link;
})();
function setTabCloak(value) {
if (value === 'google') {
document.title = 'Google';
favicon.href = 'https://www.google.com/favicon.ico';
} else if (value === 'vocab') {
document.title = 'My Learning | Vocabulary.com';
favicon.href = 'https://www.vocabulary.com/favicon.ico';
} else {
favicon.href = '/favicon.ico';
}
// Save choice for other pages
localStorage.setItem('tabCloaker', value);
}
tabCloaker.addEventListener('change', e => setTabCloak(e.target.value));
// On load, set dropdown and tab
const saved = localStorage.getItem('tabCloaker') || 'default';
tabCloaker.value = saved;
setTabCloak(saved);
// Background open helper: must be invoked by a user gesture (click)
function openAboutBlankInBackground() {
const newWin = window.open('about:blank', '_blank');
if (!newWin) {
console.warn('Popup blocked: cannot open about:blank in background.');
return;
}
try {
// Best-effort: try to keep focus on this page
newWin.blur();
window.focus();
} catch (e) {
// Ignore browsers that block blur/focus
}
}
const bgBtn = document.getElementById('bg-launch-btn');
if (bgBtn) bgBtn.addEventListener('click', openAboutBlankInBackground);
</script>
</main>
</div>
</body>
</html>