Is there any way to debug by the browser to stop exactly in the line that is being executed?

3

I got a complex code for maintenance and noticed that a table is constantly updating causing page to slow down.

I would like to know if you have any browsers option (chrome preference), which allows me to stop javascript execution and go to the current line that was being executed.

The point is that I do not know the line to be debugged. It has several JS files referenced and I suppose it has some script running with a setTimeout.

    
asked by anonymous 16.09.2015 / 19:29

2 answers

6

Yes, in chrome just press f12 and go to the sources tab and find the file you want to debug.

To stop at the exact moment you are running the code use the pause button marked in red in the image.

Regardless of the file being executed, chrome will find the same and stop at the corresponding line.

  

After adding the breakpoint press F10 to move the lines.

    
16.09.2015 / 19:31
0

A other solution that may be more practical than adding the breakpoint by the inspector, is by using the word:

debugger

Place this and simply open the inspector (F12), avoiding 'hunting' the file to add the breakpoint.

    
16.09.2015 / 20:22