-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblank.html
More file actions
84 lines (73 loc) · 2.96 KB
/
blank.html
File metadata and controls
84 lines (73 loc) · 2.96 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
<html>
<head>
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "ocwa441dmy");
</script>
<script>
function openCustomWindow() {
// Open a new blank window
let win = window.open("about:blank", "_blank", "width=800,height=600");
// Set the window's body styling
win.document.body.style.margin = "0";
win.document.body.style.height = "100vh";
win.document.body.style.display = "flex";
win.document.body.style.flexDirection = "column";
// Create a header for the buttons
let header = win.document.createElement("header");
header.style.display = "flex";
header.style.justifyContent = "center";
header.style.height = "4vh";
header.style.backgroundColor = "#f0f0f0";
header.style.alignItems = "center";
header.style.borderBottom = "1px solid #ccc";
// Create the "Home" button
let homeButton = win.document.createElement("button");
homeButton.innerText = "Home";
homeButton.style.marginRight = "10px";
homeButton.style.height = "100%";
homeButton.style.padding = "10px";
// Create the "Reload" button
let reloadButton = win.document.createElement("button");
reloadButton.innerText = "Reload";
reloadButton.style.height = "100%";
reloadButton.style.padding = "10px";
// Append buttons to the header
header.appendChild(homeButton);
header.appendChild(reloadButton);
// Add the header to the new window's body
win.document.body.appendChild(header);
// Create the iframe
let iframe = win.document.createElement("iframe");
iframe.style.border = "none";
iframe.style.width = "100%";
iframe.style.height = "96vh"; // Leaves space for the header
iframe.src = location.origin; // Use the current page's origin
// Add the iframe to the new window's body
win.document.body.appendChild(iframe);
// Add event listeners for the buttons
homeButton.addEventListener("click", function () {
iframe.src = location.origin; // Go back to the main page (home)
});
reloadButton.addEventListener("click", function () {
iframe.contentWindow.location.reload(); // Reload the iframe content
});
}
// Call the function to open the custom window
openCustomWindow();
</script>
<style>
body {
background-color: black;
color: white;
text-align: center;
align-content: center;
}
</style>
</head>
<body>
</body>
</html>