Why my button click handler doesn't receive a breakpoint hit when using event listener breakpoint on mouse clicks?

957 views
Skip to first unread message

Tony Henrich

unread,
May 20, 2016, 1:16:00 AM5/20/16
to Google Chrome Developer Tools
I am using a third party UI framework. I wanted to learn how the event listener breakpoints work so I set one on mouse clicks in dev tools. When I click a button or a link, the thirty party js code gets a breakpoint hit in their click handler. So far so good. I don't want to see their code again so then I blackboxed their js file. I expect from that point when I refresh the page and click something, MY code will get the breakpoint hit. It doesn't. My code resides in a different js file and it's not blackboxed. I think that third party framework is using a global click handler then probably passing the event to the intended handler if the element clicked is not one of theirs.

What I want to know is that why my code never gets a breakpoint hit? Any possible explanations?




Kayce Basques

unread,
May 20, 2016, 6:14:02 PM5/20/16
to Google Chrome Developer Tools
Hi Tony. Try enabling the "Framework listeners" checkbox (Elements panel > Event listeners pane). Should help resolve the framework-wrapping portion of the event code. You might need to remove the blackbox on the framework script.

PhistucK

unread,
May 21, 2016, 3:34:59 AM5/21/16
to Google Chrome Developer Tools
I guess you are trying to find a specific event listener function in your code and my question will be as hard for you to answer as your question wants to solve that exact issue, but I will still try. :)

If you set a breakpoint (or add a debugger; statement) on a click event listener (say, its first line) in your different JavaScript file, while the third party library is black-boxed, does Chrome break on it?
I want to understand whether the event listener breakpoint feature has different results than adding your own breakpoint, so disable the event listener breakpoint feature.


PhistucK

On Fri, May 20, 2016 at 8:16 AM, Tony Henrich <thenri...@gmail.com> wrote:
I am using a third party UI framework. I wanted to learn how the event listener breakpoints work so I set one on mouse clicks in dev tools. When I click a button or a link, the thirty party js code gets a breakpoint hit in their click handler. So far so good. I don't want to see their code again so then I blackboxed their js file. I expect from that point when I refresh the page and click something, MY code will get the breakpoint hit. It doesn't. My code resides in a different js file and it's not blackboxed. I think that third party framework is using a global click handler then probably passing the event to the intended handler if the element clicked is not one of theirs.

What I want to know is that why my code never gets a breakpoint hit? Any possible explanations?




--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/f285c955-6c93-4a5a-9321-745ae1ca9c5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tony Henrich

unread,
May 21, 2016, 10:04:27 PM5/21/16
to Google Chrome Developer Tools
Putting a breakpoint in my code will cause Chrome to break on it. I am not sure what this has to do with event listener breakpoints. They should work independently.


On Saturday, May 21, 2016 at 12:34:59 AM UTC-7, PhistucK wrote:
I guess you are trying to find a specific event listener function in your code and my question will be as hard for you to answer as your question wants to solve that exact issue, but I will still try. :)

If you set a breakpoint (or add a debugger; statement) on a click event listener (say, its first line) in your different JavaScript file, while the third party library is black-boxed, does Chrome break on it?
I want to understand whether the event listener breakpoint feature has different results than adding your own breakpoint, so disable the event listener breakpoint feature.


PhistucK

On Fri, May 20, 2016 at 8:16 AM, Tony Henrich <thenri...@gmail.com> wrote:
I am using a third party UI framework. I wanted to learn how the event listener breakpoints work so I set one on mouse clicks in dev tools. When I click a button or a link, the thirty party js code gets a breakpoint hit in their click handler. So far so good. I don't want to see their code again so then I blackboxed their js file. I expect from that point when I refresh the page and click something, MY code will get the breakpoint hit. It doesn't. My code resides in a different js file and it's not blackboxed. I think that third party framework is using a global click handler then probably passing the event to the intended handler if the element clicked is not one of theirs.

What I want to know is that why my code never gets a breakpoint hit? Any possible explanations?




--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.

PhistucK

unread,
May 22, 2016, 2:49:23 AM5/22/16
to Google Chrome Developer Tools
What I mean is, are you sure that your function is running when the user clicks?


PhistucK

On Sun, May 22, 2016 at 5:04 AM, Tony Henrich <thenri...@gmail.com> wrote:
Putting a breakpoint in my code will cause Chrome to break on it. I am not sure what this has to do with event listener breakpoints. They should work independently.

On Saturday, May 21, 2016 at 12:34:59 AM UTC-7, PhistucK wrote:
I guess you are trying to find a specific event listener function in your code and my question will be as hard for you to answer as your question wants to solve that exact issue, but I will still try. :)

If you set a breakpoint (or add a debugger; statement) on a click event listener (say, its first line) in your different JavaScript file, while the third party library is black-boxed, does Chrome break on it?
I want to understand whether the event listener breakpoint feature has different results than adding your own breakpoint, so disable the event listener breakpoint feature.


PhistucK

On Fri, May 20, 2016 at 8:16 AM, Tony Henrich <thenri...@gmail.com> wrote:
I am using a third party UI framework. I wanted to learn how the event listener breakpoints work so I set one on mouse clicks in dev tools. When I click a button or a link, the thirty party js code gets a breakpoint hit in their click handler. So far so good. I don't want to see their code again so then I blackboxed their js file. I expect from that point when I refresh the page and click something, MY code will get the breakpoint hit. It doesn't. My code resides in a different js file and it's not blackboxed. I think that third party framework is using a global click handler then probably passing the event to the intended handler if the element clicked is not one of theirs.

What I want to know is that why my code never gets a breakpoint hit? Any possible explanations?




--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/3be5aa0b-d97c-43eb-9c03-6519cbd8e832%40googlegroups.com.

Tony Henrich

unread,
May 22, 2016, 3:15:05 AM5/22/16
to Google Chrome Developer Tools

Yes it does. My code displays a pop up window and the window gets displayed.

Also an event listener breakpoint is hit in the blackboxed js file (third party one) with a yellow background color message that says 'This script is blackboxed in debugger'. The question to Chrome is .. if it's blackboxed and you know it's blackboxed, why did you break in it?



On Thursday, May 19, 2016 at 10:16:00 PM UTC-7, Tony Henrich wrote:

PhistucK

unread,
May 22, 2016, 4:00:50 AM5/22/16
to Google Chrome Developer Tools
Is that the question? The subject asks why it does not break in your code...
There are two questions here. Both of them seem like separate bugs, though.

Have you tried the latest Chrome canary? I believe it has certain fixes regarding blackboxing.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

Tony Henrich

unread,
May 22, 2016, 4:08:54 AM5/22/16
to Google Chrome Developer Tools
It breaks in the third party code instead of mine. I added the question of why it's breaking there instead of mine.
I am using both latest Chrome and Canary. They exhibit the same behavior.

On Sunday, May 22, 2016 at 1:00:50 AM UTC-7, PhistucK wrote:
Is that the question? The subject asks why it does not break in your code...
There are two questions here. Both of them seem like separate bugs, though.

Have you tried the latest Chrome canary? I believe it has certain fixes regarding blackboxing.


PhistucK

On Sun, May 22, 2016 at 10:15 AM, Tony Henrich <thenri...@gmail.com> wrote:

Yes it does. My code displays a pop up window and the window gets displayed.

Also an event listener breakpoint is hit in the blackboxed js file (third party one) with a yellow background color message that says 'This script is blackboxed in debugger'. The question to Chrome is .. if it's blackboxed and you know it's blackboxed, why did you break in it?


On Thursday, May 19, 2016 at 10:16:00 PM UTC-7, Tony Henrich wrote:
I am using a third party UI framework. I wanted to learn how the event listener breakpoints work so I set one on mouse clicks in dev tools. When I click a button or a link, the thirty party js code gets a breakpoint hit in their click handler. So far so good. I don't want to see their code again so then I blackboxed their js file. I expect from that point when I refresh the page and click something, MY code will get the breakpoint hit. It doesn't. My code resides in a different js file and it's not blackboxed. I think that third party framework is using a global click handler then probably passing the event to the intended handler if the element clicked is not one of theirs.

What I want to know is that why my code never gets a breakpoint hit? Any possible explanations?




--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.

PhistucK

unread,
May 22, 2016, 4:33:46 AM5/22/16
to Google Chrome Developer Tools
You can search crbug.com for an existing issue and star it. If you cannot find one, file a new issue using the "New issue" link on the same page.
Please, do not add a "+1" or "Me too" or "Confirmed" (or similar) comment. It just wastes the time of Chrome engineers and sends unnecessary e-mails to all of the people who starred the issue.

You can reply with a link to the found or created issue and might get triaged (and fixed) faster.

Thank you.



PhistucK

On Sun, May 22, 2016 at 11:08 AM, Tony Henrich <thenri...@gmail.com> wrote:
It breaks in the third party code instead of mine. I added the question of why it's breaking there instead of mine.
I am using both latest Chrome and Canary. They exhibit the same behavior.

On Sunday, May 22, 2016 at 1:00:50 AM UTC-7, PhistucK wrote:
Is that the question? The subject asks why it does not break in your code...
There are two questions here. Both of them seem like separate bugs, though.

Have you tried the latest Chrome canary? I believe it has certain fixes regarding blackboxing.


PhistucK

On Sun, May 22, 2016 at 10:15 AM, Tony Henrich <thenri...@gmail.com> wrote:

Yes it does. My code displays a pop up window and the window gets displayed.

Also an event listener breakpoint is hit in the blackboxed js file (third party one) with a yellow background color message that says 'This script is blackboxed in debugger'. The question to Chrome is .. if it's blackboxed and you know it's blackboxed, why did you break in it?


On Thursday, May 19, 2016 at 10:16:00 PM UTC-7, Tony Henrich wrote:
I am using a third party UI framework. I wanted to learn how the event listener breakpoints work so I set one on mouse clicks in dev tools. When I click a button or a link, the thirty party js code gets a breakpoint hit in their click handler. So far so good. I don't want to see their code again so then I blackboxed their js file. I expect from that point when I refresh the page and click something, MY code will get the breakpoint hit. It doesn't. My code resides in a different js file and it's not blackboxed. I think that third party framework is using a global click handler then probably passing the event to the intended handler if the element clicked is not one of theirs.

What I want to know is that why my code never gets a breakpoint hit? Any possible explanations?




--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/bf6e6006-5b7e-4d9c-b364-c6ba5cdf5532%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages