I want to ignore, remove, or stop all keydown
events bounded to a DOM.
I have used the following code. but it just works in the console. I need to run it on the page and out of the console.
var events = getEventListeners(document);
var keydowns = events.keydown;
keydowns.forEach(element => {
document.removeEventListener(element.type, element.listener);
});
The problem is getEventListeners() function is defined only in the console and is undefined on the page.