4 ms·
Not directly console.log related, but you can use the console-only monitorEvents() method to log all the events triggered on an element: https://developers.goo
by e67f70028a46fba 5y ago
Not directly console.log related, but you can use the console-only monitorEvents() method to log all the events triggered on an element:
https://developers.google.com/web/updates/2015/05/quickly-monitor-events-from-the-console-panel https://developers.google.com/web/updates/2015/05/quickly-mo...
Very useful when you are wiring events together on the front end.
Surprised there isn’t a standard way to do this in the DOM.
- gonzo41 5y agoI did not know this. Thanks!
- sombremesa 5y ago> Not directly console.log related Don't worry, neither is the article. Words don't mean much I guess.
- Liquidor 5y agoYou can also use monitor(func), debug(func) and inspect(func) and more :) https://developer.chrome.com/docs/devtools/console/utilities/#monitor https://developer.chrome.com/docs/devtools/console/utilities...
- jakub_g 5y agoMy favorites: - `$0` to refer to last selected DOM node - `copy(obj)` to copy something to clipboard (that might be hard to copy manually; for example long strings are often cut when selecting manually for copying)
- yawaworht1978 5y agoThis is amazing, does it point to the event handler as well?
- throwaway_2047 5y agoI used a bookmarklet on chrome > javascript:(function(){console.log("monitor event"); window.addEventListener('message', (e) => {console.log(e);});})(); that way I can click the bookmark and start monitoring events whenever I want