Firefox has a feature in debugger that lists events for nodes - here's a help article for it.
For unclear reasons, I can't find a way to remove any of those listeners. How do I do that?
The removeEventListener() is an inbuilt function in JavaScript which removes an event handler from an element for a attached event. for example, if a button is disabled after one click you can use removeEventListener() to remove a click event listener.
Solution 2: FirefoxThe “search icon” button DOM node will be automatically highlighted in the Firefox “Inspector” tab. Click on the word “event” on the highlighted DOM node to see all the events bound to the element. Click on the right-pointing arrowhead to expand the event listener.
On the page, right-click the element you want to debug event listeners for, then click Inspect Element. In chromium-based browsers like MS Edge and Google Chrome, click the Event Listeners tab in Developer Tools. There, you’ll see a list of all of the events being listened to on that element.
The inspector shows the word "event" next to elements in the HTML Pane, that have event listeners bound to them: Click the icon, then you'll see a popup listing all the event listeners bound to this element:
The inspector shows the word "event" next to elements in the HTML Pane, that have event listeners bound to them: Click the icon, then you'll see a popup listing all the event listeners bound to this element: Each line contains: a right-pointing arrowhead; click to expand the row and show the listener function source code.
To break when event listeners are hit, check the boxes next the events you are interested in. All of the standard events supported in your version of Firefox are listed, arranged by which API or API area they’re part of.
The same feature is there from the inspector in Chrome, but as you say not in (newish) DevTools in Firefox.
Before DevTools, it was there in Firebug (screenshot), but the issue to port it across has been open for 3 years.
It seems that right-clicking the element in the inspector, choosing "Edit as HTML" and modifying the html code (even as slighltly as adding a space after the code) makes the listener go away
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With