-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathother.html
61 lines (55 loc) · 1.73 KB
/
other.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<input type="text" id="goto" />
<div><span>hello</span></div>
<button id="btn1">
click
</button>
<button id="btn2">
click 2
</button>
<button id="btn3">
click 3
</button>
<script>
btn1.addEventListener('click', () => {
const win = window.open('', 'bla1', 'name=bla2,width=500,height=590,top=264,left=4353,status=1,resizable=1,scrollbars=1', true);
setTimeout(() => {
const script = win.document.createElement('script');
script.innerHTML = `window.location.replace('https://www.google.com');`;
try {
win.document.appendChild(script);
} catch (err) {
win.document.body.appendChild(script);
}
}, 1000);
});
btn2.addEventListener('click', () => {
const win = window.open('', 'bla2', 'name=bla2,width=500,height=590,top=264,left=4353,status=1,resizable=1,scrollbars=1', true);
const toURL = goto.value || "https://www.google.com";
win.document.write("Hello World!");
setTimeout(() => {
win.location.replace(toURL);
}, 1000);
})
btn3.addEventListener('click', () => {
const win = window.open('', 'bla3', 'name=bla2,width=500,height=590,top=264,left=4353,status=1,resizable=1,scrollbars=1', true);
const script = win.document.createElement('script');
script.innerHTML = `window.open('https://www.google.com','_self');`;
setTimeout(() => {
try {
win.document.appendChild(script);
} catch (err) {
win.document.body.appendChild(script);
}
}, 1000);
})
</script>
</body>
</html>