Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome debugger inject javascript

I have this curiosity,

Is it, in some way, possible to inject javascript in my page and execute it and debug it? As you do with the console, but in the console you can't pause and watch variables.

Is it possible to debug code that i put through console? Why isn't it possible to debug code received via XHR?

Thanks!

like image 244
Andr Avatar asked Feb 02 '23 20:02

Andr


1 Answers

One trick I learned today from Chromium is that if you place the word:

debugger;

Right before the statement you want to debug. It will break on the debugger. It is really useful for injected scripts.

like image 135
Mohamed Mansour Avatar answered Feb 05 '23 16:02

Mohamed Mansour