-
Notifications
You must be signed in to change notification settings - Fork 0
/
failed2.html
74 lines (72 loc) · 2.13 KB
/
failed2.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Open Link in about:blank</title>
<style>
body {
font-family: 'Courier New', Courier, monospace;
text-align: center;
background-color: #f4f4f4;
color: #333;
margin: 0;
padding: 20px;
}
input {
width: 60%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}
button {
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #333;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #555;
}
h1 {
font-size: 24px;
margin-bottom: 20px;
}
p {
font-size: 16px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<h1>Open Link in a New about:blank Page</h1>
<p>Enter a URL below and click the button to open it in a new <code>about:blank</code> page:</p>
<input type="text" id="urlInput" placeholder="Enter URL here">
<button onclick="openLink()">Open Link</button>
<script>
function openLink() {
const url = document.getElementById('urlInput').value;
console.log('URL entered:', url);
if (!url) {
alert('Please enter a valid URL.');
console.log('No URL entered.');
return;
}
const newWindow = window.open('about:blank', '_blank');
if (newWindow) {
console.log('New window opened successfully.');
newWindow.location.href = url;
console.log('URL set in the new window:', url);
} else {
console.error('Failed to open new window.');
}
}
</script>
</body>
</html>