OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to add breakpoints for custom events?

  • Thread starter Thread starter Denilson Sá Maia
  • Start date Start date
D

Denilson Sá Maia

Guest
If I want to debug standard DOM events, the browser dev tools make it easy to have Event Listener Breakpoints.

But now I need to debug custom events that are created with CustomEvent("foobar-happened") and dispatched with dispatchEvent(…). I don't see those in the browser devtools. How can I inspect such custom events?



No, I cannot (or should not) add debugger statements to the code that dispatches those events. Such code is coming from outside my project (e.g. from a third-party library, or code from another team), and it may be unfeasible for me to find all the places to add such debugger statements.

<p>If I want to <a href="https://stackoverflow.com/questions...events-fired-on-an-element-in-chrome-devtools">debug standard DOM events</a>, the browser dev tools make it easy to have <a href="https://developer.chrome.com/docs/devtools/javascript/breakpoints/#event-listeners" rel="nofollow noreferrer">Event Listener Breakpoints</a>.</p>
<p>But now I need to debug <a href="https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent" rel="nofollow noreferrer">custom events</a> that are created with <a href="https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent" rel="nofollow noreferrer">CustomEvent("foobar-happened")</a> and dispatched with <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent" rel="nofollow noreferrer">dispatchEvent(…)</a>. I don't see those in the browser devtools. How can I inspect such custom events?</p>
<hr />
<p>No, I cannot (or should not) add <code>debugger</code> statements to the code that dispatches those events. Such code is coming from outside my project (e.g. from a third-party library, or code from another team), and it may be unfeasible for me to find all the places to add such debugger statements.</p>
 

Latest posts

A
Replies
0
Views
1
Ashrik Ahamed
A
A
Replies
0
Views
1
Ashrik Ahamed
A

Online statistics

Members online
0
Guests online
3
Total visitors
3
Top