1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Element.prototype.originalAddEventListener = Element.prototype.addEventListener;
Element.prototype.addEventListener = function (type, fct, capture) {
// init
this.eventListenerList = this.eventListenerList || {};
this.eventListenerList[type] = this.eventListenerList[type] || [];
capture = capture || false;
// appel fonction original
this.originalAddEventListener( type, fct, capture);
// sauvegarde dans liste
this.eventListenerList[type].push({
listener: fct,
useCapture: capture
})
}; |
Partager