Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove event listeners in Firefox debugger?

Firefox has a feature in debugger that lists events for nodes - here's a help article for it.

image description

For unclear reasons, I can't find a way to remove any of those listeners. How do I do that?

like image 267
Tomáš Zato - Reinstate Monica Avatar asked May 17 '16 18:05

Tomáš Zato - Reinstate Monica


People also ask

How do I delete an event listener?

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.

Where is event listener in Firefox?

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.

How do I debug event listeners in chrome?

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.

How do I list all the event listeners for an 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:

How do I view event listeners in the Inspector?

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.

How do I break when an event listener is hit?

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.


2 Answers

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.

like image 58
df778899 Avatar answered Sep 19 '22 02:09

df778899


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

like image 26
Jan Clode Avatar answered Sep 21 '22 02:09

Jan Clode