Javascript – dump all handlers on window object

DOM window object has many javascript event handlers attached to it. It may be handy to dump and view all of these. Here is code to display all handlers on window object which begins with on (e.g. onerror).

<script type="text/javascript">
document.write("<pre>")
var a = [];
for (key in window) {
  if (/^on/.test(key)) {
    a.push(key);
  }
}
a.sort();
for (i=0; i < a.length; i++) {
  document.write((i+1) + ". " + a[i] + "\n");
}
document.write("</pre>")
</script>

Chrome – dump of all window handlers

Dump of all handler beginning with on in Chrome Version 47.0.2526.80 (64-bit) on Mac

1 onabort
2 onanimationend
3 onanimationiteration
4 onanimationstart
5 onautocomplete
6 onautocompleteerror
7 onbeforeunload
8 onblur
9 oncancel
10 oncanplay
11 oncanplaythrough
12 onchange
13 onclick
14 onclose
15 oncontextmenu
16 oncuechange
17 ondblclick
18 ondevicemotion
19 ondeviceorientation
20 ondrag
21 ondragend
22 ondragenter
23 ondragleave
24 ondragover
25 ondragstart
26 ondrop
27 ondurationchange
28 onemptied
29 onended
30 onerror
31 onfocus
32 onhashchange
33 oninput
34 oninvalid
35 onkeydown
36 onkeypress
37 onkeyup
38 onlanguagechange
39 onload
40 onloadeddata
41 onloadedmetadata
42 onloadstart
43 onmessage
44 onmousedown
45 onmouseenter
46 onmouseleave
47 onmousemove
48 onmouseout
49 onmouseover
50 onmouseup
51 onmousewheel
52 onoffline
53 ononline
54 onpagehide
55 onpageshow
56 onpause
57 onplay
58 onplaying
59 onpopstate
60 onprogress
61 onratechange
62 onreset
63 onresize
64 onscroll
65 onsearch
66 onseeked
67 onseeking
68 onselect
69 onshow
70 onstalled
71 onstorage
72 onsubmit
73 onsuspend
74 ontimeupdate
75 ontoggle
76 ontransitionend
77 onunload
78 onvolumechange
79 onwaiting
80 onwebkitanimationend
81 onwebkitanimationiteration
82 onwebkitanimationstart
83 onwebkittransitionend
84 onwheel

Firefox – dump of all window handlers

Dump of all handlers beginning with on in Firefox Version 42.0 on Mac

1. onabort
2. onafterprint
3. onbeforeprint
4. onbeforeunload
5. onblur
6. oncanplay
7. oncanplaythrough
8. onchange
9. onclick
10. oncontextmenu
11. ondblclick
12. ondevicelight
13. ondevicemotion
14. ondeviceorientation
15. ondeviceproximity
16. ondrag
17. ondragend
18. ondragenter
19. ondragleave
20. ondragover
21. ondragstart
22. ondrop
23. ondurationchange
24. onemptied
25. onended
26. onerror
27. onfocus
28. onhashchange
29. oninput
30. oninvalid
31. onkeydown
32. onkeypress
33. onkeyup
34. onlanguagechange
35. onload
36. onloadeddata
37. onloadedmetadata
38. onloadstart
39. onmessage
40. onmousedown
41. onmouseenter
42. onmouseleave
43. onmousemove
44. onmouseout
45. onmouseover
46. onmouseup
47. onmozfullscreenchange
48. onmozfullscreenerror
49. onmozpointerlockchange
50. onmozpointerlockerror
51. onoffline
52. ononline
53. onpagehide
54. onpageshow
55. onpause
56. onplay
57. onplaying
58. onpopstate
59. onprogress
60. onratechange
61. onreset
62. onresize
63. onscroll
64. onseeked
65. onseeking
66. onselect
67. onshow
68. onstalled
69. onsubmit
70. onsuspend
71. ontimeupdate
72. onunload
73. onuserproximity
74. onvolumechange
75. onwaiting
76. onwheel

Microsoft Edge – dump of all window handlers

Dump of all handler beginning with on in Edge version 20.10240.16384.0 on Windows 10

1. onabort
2. onafterprint
3. onbeforeprint
4. onbeforeunload
5. onblur
6. oncanplay
7. oncanplaythrough
8. onchange
9. onclick
10. oncompassneedscalibration
11. oncontextmenu
12. ondblclick
13. ondevicemotion
14. ondeviceorientation
15. ondrag
16. ondragend
17. ondragenter
18. ondragleave
19. ondragover
20. ondragstart
21. ondrop
22. ondurationchange
23. onemptied
24. onended
25. onerror
26. onfocus
27. onhashchange
28. oninput
29. onkeydown
30. onkeypress
31. onkeyup
32. onload
33. onloadeddata
34. onloadedmetadata
35. onloadstart
36. onmessage
37. onmousedown
38. onmouseenter
39. onmouseleave
40. onmousemove
41. onmouseout
42. onmouseover
43. onmouseup
44. onmousewheel
45. onmsgesturechange
46. onmsgesturedoubletap
47. onmsgestureend
48. onmsgesturehold
49. onmsgesturestart
50. onmsgesturetap
51. onmsinertiastart
52. onoffline
53. ononline
54. onpagehide
55. onpageshow
56. onpause
57. onplay
58. onplaying
59. onpointercancel
60. onpointerdown
61. onpointerenter
62. onpointerleave
63. onpointermove
64. onpointerout
65. onpointerover
66. onpointerup
67. onpopstate
68. onprogress
69. onratechange
70. onreadystatechange
71. onreset
72. onresize
73. onscroll
74. onseeked
75. onseeking
76. onselect
77. onstalled
78. onstorage
79. onsubmit
80. onsuspend
81. ontimeupdate
82. onunload
83. onvolumechange
84. onwaiting
85. onwheel

Microsoft IE 11 – dump of all window handlers

Dump of all handler beginning with on in IE 11 version – on Windows 10

1. onabort
2. onafterprint
3. onbeforeprint
4. onbeforeunload
5. onblur
6. oncanplay
7. oncanplaythrough
8. onchange
9. onclick
10. oncompassneedscalibration
11. oncontextmenu
12. ondblclick
13. ondevicemotion
14. ondeviceorientation
15. ondrag
16. ondragend
17. ondragenter
18. ondragleave
19. ondragover
20. ondragstart
21. ondrop
22. ondurationchange
23. onemptied
24. onended
25. onerror
26. onfocus
27. onfocusin
28. onfocusout
29. onhashchange
30. onhelp
31. oninput
32. onkeydown
33. onkeypress
34. onkeyup
35. onload
36. onloadeddata
37. onloadedmetadata
38. onloadstart
39. onmessage
40. onmousedown
41. onmouseenter
42. onmouseleave
43. onmousemove
44. onmouseout
45. onmouseover
46. onmouseup
47. onmousewheel
48. onmsgesturechange
49. onmsgesturedoubletap
50. onmsgestureend
51. onmsgesturehold
52. onmsgesturestart
53. onmsgesturetap
54. onmsinertiastart
55. onmspointercancel
56. onmspointerdown
57. onmspointerenter
58. onmspointerleave
59. onmspointermove
60. onmspointerout
61. onmspointerover
62. onmspointerup
63. onoffline
64. ononline
65. onpagehide
66. onpageshow
67. onpause
68. onplay
69. onplaying
70. onpointercancel
71. onpointerdown
72. onpointerenter
73. onpointerleave
74. onpointermove
75. onpointerout
76. onpointerover
77. onpointerup
78. onpopstate
79. onprogress
80. onratechange
81. onreadystatechange
82. onreset
83. onresize
84. onscroll
85. onseeked
86. onseeking
87. onselect
88. onstalled
89. onstorage
90. onsubmit
91. onsuspend
92. ontimeupdate
93. onunload
94. onvolumechange
95. onwaiting

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments