-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathwindowfeatures.html
More file actions
52 lines (49 loc) · 1.35 KB
/
Copy pathwindowfeatures.html
File metadata and controls
52 lines (49 loc) · 1.35 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Window Features</title>
<style>
#log {
border: 1px solid black;
margin-top: 100px;
width: 100%;
min-height: 100px;
}
</style>
</head>
<body>
<div id=props>
</div>
<pre id="log"></pre>
<script type="text/javascript">
const props = [
'window.locationbar.visible',
'window.menubar.visible',
'window.personalbar.visible',
'window.scrollbars.visible',
'window.statusbar.visible',
'window.toolbar.visible',
'window.screenLeft',
'window.screenTop',
'window.outerWidth',
'window.outerHeight'];
const propsEl = document.getElementById('props');
props.forEach(p => {
let v = null;
try {
v = eval(p);
} catch(e) {
v = e;
}
let div = document.createElement("div");
div.innerText = p + ": " + v;
propsEl.appendChild(div);
});
window.addEventListener("message",(e) => {
document.getElementById("log").textContent += "Message: " + e.data + "\n";
}, false);
window.opener.postMessage("Thanks opener!", "*");
</script>
</body>
</html>