-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.html
52 lines (44 loc) · 1.47 KB
/
settings.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Boredom Games | Settings</title>
<link rel="stylesheet" href="/index.css">
</head>
<body>
<button class="button is-link is-outlined"> <a href="/index.html">Home</a>
<button class="is-unselectable" onclick="openPopup()">Open In About blank
</button>
<script>
function openPopup(title, iconUrl) {
let inFrame;
try {
inFrame = window !== top;
} catch (e) {
inFrame = true;
}
if (!inFrame && !navigator.userAgent.includes("Firefox")) {
const popup = window.open("about:blank", "_blank");
if (!popup || popup.closed) {
} else {
const doc = popup.document;
doc.title = title;
const link = doc.createElement("link");
link.rel = "icon";
link.href = iconUrl;
doc.head.appendChild(link);
const iframe = doc.createElement("iframe");
const style = iframe.style;
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.body.appendChild(iframe);
location.replace("about:blank");
}
}
}
</script>
</body>