chrome控制台一些比较实用的操作

打开控制台按Ctrl + Shift + P命令可以发现很多操作:

1、截取dom元素:选中需要打印的节点:选中 Screenshot Capture full size screenshot   命令; 可以打印页面长图

2、重新发起xhr请求:

Network面板右键需要重新发起请求的xhr,执行Replay XHR

3、copy()方法复制节点:

copy(location),粘贴得出

{
  "href": "https://tieba.baidu.com/index.html",
  "ancestorOrigins": {},
  "origin": "https://tieba.baidu.com",
  "protocol": "https:",
  "host": "tieba.baidu.com",
  "hostname": "tieba.baidu.com",
  "port": "",
  "pathname": "/index.html",
  "search": "",
  "hash": ""
}

4、打印文档节点对象

console.log([document.getElementById('s_top_wrap')]);

猜你喜欢

转载自www.cnblogs.com/peter-web/p/13169450.html