With (Tamper|Violent|Grease)monkey, you can run any JavaScript code on any web pages. This allows you to rewrite the content and style of web pages and override their behaviors. However, manipulating the event listeners is a bit more difficult. In particular, to disable or delete a registered event listener, you must have a reference to the event listener function object, which is usually not available. Chrome DevTools (or similar browser developer functionalities) can do this, but in any case it is not available from Tampermonkey.
This code snippet will help you to remove event listeners by inserting a hook into EventTarget.proptotype.addEventListener
, the standard method for registering event listeners, and logging all calls to it. For example, to remove all click
events, you can use the following code:
//...
(function() {
'use strict';
window.addEventListene