Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging a script added via Chrome Console

I am adding some JavaScripts via Chrome's devtools' console by simply just pasting a set of code. There is no way to open that code on the Sources panel so I can debug using breakpoints. Is there a proper way to open the code on the Sources panel that was added via console?

Any other ways than adding debugger; along with the code. Or a syntax error, which then shows me the file name on the right side, which opens the code in a tab in the Sources panel. Attached the two scenerios on the screenshot attached.

enter image description here

like image 977
Suthan Bala Avatar asked Oct 27 '25 19:10

Suthan Bala


1 Answers

Open the devtool and open the Sources tab. Click on the Snippets tab on create a new snippet. Write yout code in the snippet. Then right click on the snippet created and click run !! You should be able to debug from here ;)

like image 56
R. Foubert Avatar answered Oct 29 '25 07:10

R. Foubert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!