当前位置:网站首页>Chrome debugging tips

Chrome debugging tips

2022-06-23 05:00:00 cuncaojin

Chrome Debugging skills

demand : Any web page , Click anywhere , Find the exact location of the network request code in the source code .
Maybe the web page is constantly refreshing data , And soon , And browser plug-ins 、 Advertising, etc .

1. format js Code

 Insert picture description here

2. Turn on BlackBoxing

reason : Screen out the pages that you don't care about js File access network , Such as advertising Library , The third party js Kuo et al
practice : To be opened BlackBoxing function
operation : F12 => F1 => Blackboxing , Select the check box , Here's the picture :
 Insert picture description here

It's not over yet. , Need to add rules . You can write regular expressions , But there are simple ways , That is to say Sources Open in js file , format js file , Then right-click the line number , choice Stop blackboxing, Here's the picture :
 Insert picture description here
, Then you can see the change
 Insert picture description here

3. Powerful Source panel

 Insert picture description here

DOM The breakpoint for node change monitoring
 Insert picture description here

Network request data view 、 Breakpoint addition
 Insert picture description here

4. format Json data

console in , Input copy( To format json data ), Then press enter , In this case, the formatted Json data Has been copied to the clipboard , Try pasting it , Another copy was printed out .
 Insert picture description here

5. Network, Find out my click requests

 Insert picture description here

6. Shortcut key

Ctrl + Shift + F : Choose Sources -> Page The top folder in the , Press the shortcut key , You can search the source file for the file to which the string of the specified rule belongs
Ctrl + Shift: With the previous shortcut key , You can search for useful information in the specified file
Ctrl + P: Quick location of files
Ctrl + Shift + O: Quick positioning function
Ctrl + G: Quickly navigate to a line in the file

7. Snippets (JS Editor ,Sources Next )

8. debugger

Add... To the source file debugger The debugging operation stops here

9. Debug button

 Insert picture description here

  • Go to the next breakpoint or stop
  • next step ( Don't go into functions )
  • next step ( If there is a function, enter )
  • Jump out of function
  • a step
  • Breakpoint switch , Grey is the breakpoint , Blue indicates that the breakpoint is unavailable
  • Whether to interrupt the switch when encountering an exception code
原网站

版权声明
本文为[cuncaojin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206222344404511.html