Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

props.html 1.4KB

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