Monitor Events and Function Calls via Console

Despite having worked on the very complex Firefox for a number of years, I’ll always love plain old console.log debugging. Logging can provide an audit trail as events happen and text you can share with others. Did you know that chrome provides monitorEvents and monitor so that you can get a log each time an event occurs or function is called? Monitor Events Pass an element and a series of events to monitorEvents to get a console log when the event happens: // Monitor any clicks within the window monitorEvents(window, 'click') // Monitor for keyup and keydown events on the body monitorEvents(document.body, ['keyup', 'keydown']) You can pass an array of events to listen for multiple... more →
Posted in: JavaScript