-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
98 lines (88 loc) · 2.57 KB
/
index.html
File metadata and controls
98 lines (88 loc) · 2.57 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Loading…</title>
<style>
body {
font-family: system-ui, sans-serif;
margin: 2rem;
}
#msg {
max-width: 600px;
line-height: 1.6;
}
:root { color-scheme: light dark; }
</style>
</head>
<body>
<div id="msg">Attempting to open site…</div>
<script>
const targetUrl = "https://studyworkandmore.uk";
let retryTimer = null;
function tryOpen() {
const msg = document.getElementById("msg");
msg.textContent = "Opening Popup, this should only take a few seconds…";
const popup = window.open("about:blank", "_blank");
// If blocked
if (!popup) {
msg.innerHTML = `
<strong>⚠ Pop-up Blocked</strong><br><br>
Your browser blocked the new tab.<br><br>
<strong>Fix:</strong><br>
• Chrome: Click the pop-up blocked icon → “Always allow”, and then confirm<br>
• Firefox: Click “Allow pop-ups” in the yellow bar<br>
• Edge: Same as Chrome<br><br>
Retrying every 3 seconds…
`;
return;
}
// Build contents of the about:blank tab
popup.opener = null;
const html = `
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="referrer" content="no-referrer">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>about:blank</title>
<style>
:root { color-scheme: light dark; }
html, body { height: 100%; margin: 0; }
iframe {
width: 100%;
height: 100%;
border: 0;
}
</style>
</head>
<body>
<iframe
src="${targetUrl}"
allow="camera; microphone; fullscreen; clipboard-read; clipboard-write; geolocation; autoplay; encrypted-media; web-share; *"
allowfullscreen
allowpaymentrequest
loading="eager"
referrerpolicy="no-referrer"
></iframe>
</body>
</html>
`;
// Write to popup
popup.document.open();
popup.document.write(html);
popup.document.close();
// Success → close parent immediately
window.close();
}
// Try immediately
tryOpen();
// Retry every 3 seconds if blocked
retryTimer = setInterval(() => {
tryOpen();
}, 3000);
</script>
</body>
</html>