Skip to content

Instantly share code, notes, and snippets.

View Jeraldy's full-sized avatar
🎯
Focusing

Jeraldy Deus Jeraldy

🎯
Focusing
View GitHub Profile
@Jeraldy
Jeraldy / listAllEventListeners.js
Created May 14, 2020 14:13 — forked from dmnsgn/listAllEventListeners.js
List all event listeners in a document
const listeners = (function listAllEventListeners() {
let elements = [];
const allElements = document.querySelectorAll('*');
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
for (let i = 0; i < allElements.length; i++) {
const currentElement = allElements[i];