And it's not only that, timer events, and others are really tricky to debug, and you would generally just want to trace expressions, preferrably without changing the underlying code.
How can you then create trace calls, to see various variable states?
Well it's relatively simple, we will add tracer breakpoints:
First we will simple evaluate the previous function in the web console of your favourite browser.
Now we can simply add a conditional breakpoint, with a condition such as:
Since the breakpoint is evaluated in the context of the current stack, variables such as node will be accessible, if they are present in the code.
Also, since the function always returns false, the debugger won't stop there, thus no blur/focus events will be triggered.
If you also need a conditional breakpoint exactly at the line where the log is you can use as expression something along these lines:
Thus the log will take place, and since it's false, it will fallback in evaluating the actual value that you want the debugger to stop.
Have fun debugging.