If you're in need of assistance, there is something that may be able to aid you.
An option for monitoring objects is through the usage of Objects.observe.
Additionally, there are mutation event listeners available for specific DOM elements, as well as a mutation observer.
In scenarios where all events must be monitored, consider redefining the addEvent function. However, this should primarily be used for debugging and testing purposes rather than as a standard practice.
// Reprogramming the functionality
var oldAddEventListener = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function(eventName, eventHandler){
// INSERT YOUR CUSTOM CODE HERE
oldAddEventListener.call(this, eventName, function(event) {
// ADDITIONAL CUSTOM CODE HERE
eventHandler(event);
});
};
For further details, visit https://css-tricks.com/capturing-all-events/