1
|
<html>
|
2
|
<head>
|
3
|
</head>
|
4
|
<body>
|
5
|
<script>(function(){
|
6
|
var props = {};
|
7
|
|
8
|
function addObject(obj) {
|
9
|
if (obj == null) return;
|
10
|
try {
|
11
|
Object.getOwnPropertyNames(obj).forEach(add);
|
12
|
} catch(ex) {}
|
13
|
if (obj.prototype) {
|
14
|
Object.getOwnPropertyNames(obj.prototype).forEach(add);
|
15
|
}
|
16
|
if (typeof obj == "function") {
|
17
|
try {
|
18
|
Object.getOwnPropertyNames(new obj).forEach(add);
|
19
|
} catch(ex) {}
|
20
|
}
|
21
|
}
|
22
|
|
23
|
function add(name) {
|
24
|
props[name] = true;
|
25
|
}
|
26
|
|
27
|
Object.getOwnPropertyNames(window).forEach(function(thing){
|
28
|
addObject(window[thing]);
|
29
|
});
|
30
|
|
31
|
try {
|
32
|
addObject(new Event("click"));
|
33
|
addObject(new Event("contextmenu"));
|
34
|
addObject(new Event("mouseup"));
|
35
|
addObject(new Event("mousedown"));
|
36
|
addObject(new Event("keydown"));
|
37
|
addObject(new Event("keypress"));
|
38
|
addObject(new Event("keyup"));
|
39
|
} catch(ex) {}
|
40
|
|
41
|
var ta = document.createElement("textarea");
|
42
|
ta.style.width = "100%";
|
43
|
ta.style.height = "20em";
|
44
|
ta.style.boxSizing = "border-box";
|
45
|
ta.value = 'export var domprops = ' + JSON.stringify(Object.keys(props).sort(cmp), null, 4);
|
46
|
document.body.appendChild(ta);
|
47
|
|
48
|
function cmp(a, b) {
|
49
|
a = a.toLowerCase();
|
50
|
b = b.toLowerCase();
|
51
|
return a < b ? -1 : a > b ? 1 : 0;
|
52
|
}
|
53
|
})();</script>
|
54
|
</body>
|
55
|
</html>
|