event log all
by Laurens Maneschijn
HTML
see console
<hr>
<label><input type="checkbox" onchange="eventlog_enabled=this.checked;">eventlog_enabled</label><br>
<label><input type="checkbox" onchange="eventlog_collapsegroups=this.checked;">eventlog_collapsegroups</label><br>
JavaScript
// https://jsfiddle.net/ElMoonLite/02dzjget/
// https://stackoverflow.com/questions/9368538/getting-an-array-of-all-dom-events-possible
// [...new Set([
// ...Object.getOwnPropertyNames(document),
// ...Object.getOwnPropertyNames(Object.getPrototypeOf(Object.getPrototypeOf(document))),
// ...Object.getOwnPropertyNames(Object.getPrototypeOf(window)),
// ].filter(k => k.startsWith("on") && (document[k] == null || typeof document[k] == "function")))];
let window_eventnames = Object.getOwnPropertyNames(window)
.filter(k => k.startsWith("on") && (window[k] == null || typeof window[k] == "function"))
.map(e => e.substr(2));
window_eventnames.sort();
let document_eventnames = Object.getOwnPropertyNames(Object.getPrototypeOf(Object.getPrototypeOf(document)))
.filter(k => k.startsWith("on") && (document[k] == null || typeof document[k] == "function"))
.map(e => e.substr(2));
document_eventnames.sort();
let HTMLBodyElement_eventnames = Object.getOwnPropertyNames(Object.getPrototypeOf(document.body))
.filter(k => k.startsWith("on") && (document.body[k] == null || typeof document.body[k] == "function"))
.map(e => e.substr(2));
HTMLBodyElement_eventnames.sort();
let HTMLElement_eventnames = Object.getOwnPropertyNames(Object.getPrototypeOf(Object.getPrototypeOf(document.body)))
.filter(k => k.startsWith("on") && (document.body[k] == null || typeof document.body[k] == "function"))
.map(e => e.substr(2));
HTMLElement_eventnames.sort();
console.log({
window_eventnames, // (119) abort afterprint animationend animationiteration animationstart appinstalled auxclick beforeinput beforeinstallprompt beforematch beforeprint beforetoggle beforeunload beforexrselect blur cancel canplay canplaythrough change click close contentvisibilityautostatechange contextlost contextmenu contextrestored cuechange dblclick devicemotion deviceorientation deviceorientationabsolute drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended error...