Skip to content

Instantly share code, notes, and snippets.

@jacob414
Created March 1, 2011 09:39
Show Gist options
  • Save jacob414/848902 to your computer and use it in GitHub Desktop.
Save jacob414/848902 to your computer and use it in GitHub Desktop.
Logs as many events as possible
// Log as many events as possible, with event names grabbed from
// webkit sources:
// http://svn.webkit.org/repository/webkit/trunk/Source/WebCore/dom/EventNames.h
known = [
'abort',
'beforecopy',
'beforecut',
'beforeload',
'beforepaste',
'beforeprocess',
'beforeunload',
'blur',
'cached',
'change',
'checking',
'click',
'close',
'complete',
'compositionend',
'compositionstart',
'compositionupdate',
'connect',
'contextmenu',
'copy',
'cut',
'dblclick',
'devicemotion',
'deviceorientation',
'display',
'downloading',
'drag',
'dragend',
'dragenter',
'dragleave',
'dragover',
'dragstart',
'drop',
'error',
'focus',
'focusin',
'focusout',
'formchange',
'forminput',
'hashchange',
'input',
'invalid',
'keydown',
'keypress',
'keyup',
'load',
'loadstart',
'message',
'mousedown',
'mousemove',
'mouseout',
'mouseover',
'mouseup',
'mousewheel',
'noupdate',
'obsolete',
'offline',
'online',
'open',
'overflowchanged',
'pagehide',
'pageshow',
'paste',
'popstate',
'readystatechange',
'reset',
'resize',
'scroll',
'search',
'select',
'selectstart',
'storage',
'submit',
'textInput',
'unload',
'updateready',
'write',
'writeend',
'writestart',
'zoom',
'DOMActivate',
'DOMFocusIn',
'DOMFocusOut',
'DOMAttrModified',
'DOMCharacterDataModified',
'DOMNodeInserted',
'DOMNodeInsertedIntoDocument',
'DOMNodeRemoved',
'DOMNodeRemovedFromDocument',
'DOMSubtreeModified',
'DOMContentLoaded',
'webkitBeforeTextInserted',
'webkitEditableContentChanged',
'canplay',
'canplaythrough',
'durationchange',
'emptied',
'ended',
'loadeddata',
'loadedmetadata',
'pause',
'play',
'playing',
'ratechange',
'seeked',
'seeking',
'timeupdate',
'volumechange',
'waiting',
'webkitbeginfullscreen',
'webkitendfullscreen',
'progress',
'stalled',
'suspend',
'webkitAnimationEnd',
'webkitAnimationStart',
'webkitAnimationIteration',
'webkitTransitionEnd',
'orientationchange',
'timeout',
'touchstart',
'touchmove',
'touchend',
'touchcancel',
'success',
'loadend',
'webkitfullscreenchange',
'webkitspeechchange',
'webglcontextlost',
'webglcontextrestored',
'webglcontextcreationerror',
'audioprocess'];
function lognamed(name) {
document.addEventListener(name, function() {
console.log(name);
}, true);
}
known.forEach(function(name) {
lognamed(name);
});
@jacob414
Copy link
Author

jacob414 commented Mar 1, 2011

If anyone know of any other event, please comment!

@bhurlow
Copy link

bhurlow commented Dec 3, 2012

this is awesome thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment