Is there any way to specify the debugger for listening for specific method names? Example: When the function myFunc
get called, I want to start debugging. Yes, I know that this seems strange, but in some projects I don't know the name of the javascript file to start the debugging, but I do know the name of the method.
It would be something like the Event Listener Breakpoints, but with an arbitrary method name instead an event name.
Add a conditional breakpoint by right clicking a line number, selecting Add Conditional Breakpoint , and entering an expression. Note: Because the conditional breakpoint simply evaluates an expression, you can add useful logging statements within the expression.
The Chrome Web Inspector and Debugger are conveniently built-in with Chrome. You can launch it by hitting F12 while in your browser or by right clicking on a web page and selecting the Inspect menu item. The images below show a few different views that you'll see in the Chrome DevTools browser.
You can find the function name with a search and set the break point. You can use the following key combination to search accross the files.
Just wanted to add another method that I came across today while searching, you can open the JS console and use debug(Some.path.to.myFunc)
and it will set a debug breakpoint on the function. Use undebug(func)
to unset it. You can also use monitor(func)
and unmonitor(func)
to get a console log when that function is called. Learned about these from: https://amasad.me/debugging
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