Util for discovering events being emitted by browser apis and dom nodes

Usage no npm install needed!

<script type="module">
  import domeventlogger from '';



What is this?

A tiny browser module for discovering what events are actually being fired by an object in the browser. Especially useful for discovering available 'hooks' for new-ish browser APIs like MediaStreams or PeerConnections.

Suitable for use with browserify/CommonJS on the client.

If you're not using browserify or you want AMD support use domeventlogger.bundle.js.


npm install domeventlogger

How to use it

See demo.html for working demo.

var domEventLogger = require('domeventlogger');

// grab some image or any browser API that lets you
// listen for 'on...' events:
img = document.getElementById('myImage');

// specify that you want to log events

// do something that will cause an event
// for example a "onload" event by specifying
// an image source attribute.
img.src = "";

// look in your console and you'll see the load event logged
// now you can mouse over the image and see mouseover, etc.
// this is great for discovering what hooks you have available to you.


screen shot


New browser APIs don't always have perfect up-to-date docs. And sometimes you're not exactly sure the order in which things are firing. This can make it easier to debug.


Don't leave this in your code in production, as it registers an event listen on every possible event hook for the element you pass it (which may not be particularly awesome for performance);



Created By

If you like this, follow @HenrikJoreteg on twitter.