не работает...
if (!addEventListenerOriginal) {
var addEventListenerOriginal = EventTarget.prototype.addEventListener;
EventTarget.prototype.addEventListener = function (evt, cb, bub) {
console.log(this, evt, cb, bub);
addEventListenerOriginal.apply(this, arguments);
}
}
document.body.addEventListener("contextmenu", console.info, true);//не как должно
EventTarget.prototype.addEventListener.call(document.body, "fuuu", console.info, true);//TypeError: addEventListenerOriginal is undefined
if (!addEventListenerOriginal) {
var addEventListenerOriginal = HTMLElement.prototype.addEventListener;
HTMLElement.prototype.addEventListener = function (evt, cb, bub) {
console.log(this, evt, cb, bub);
addEventListenerOriginal.apply(this, arguments);
}
}
document.body.addEventListener("contextmenu", console.info, true);//работает не как должно
HTMLElement.prototype.addEventListener.call(document.body, "fuuu", console.info, true);//работает как должно