As front end developers, most of our time is spent in the browser with DevTools open (almost always, unless we are watching YouTube ... sometimes even then).

作为前端开发人员,我们大部分时间都花在打开DevTools的浏览器中(几乎总是,除非我们正在观看YouTube,有时甚至是那时)。

One of the major sections in DevTools is the network tab. There are a couple of things you can do in the network tab, like the following:

DevTools中的主要部分之一是network选项卡。 您可以在[ network标签中执行以下操作:

  • Find network requests by text通过文本查找网络请求
  • Find network requests by regex expression通过正则表达式查找网络请求
  • Filter (exclude) out network requests过滤(排除)网络请求
  • Use the property filter to see network requests by a certain domain使用属性过滤器查看特定域的网络请求
  • Find network requests by resource type按资源类型查找网络请求

For the purposes of this tutorial I am using freeCodeCamp's home page, freecodecamp.org/news. Simply go to the page and open the network tab.

就本教程而言,我使用的是freeCodeCamp的主页freecodecamp.org/news 。 只需转到该页面并打开“ network标签。

You can see the network tab by hitting cmd + opt + j on your Mac or ctrl + shift + j in Windows. It will open up the console tab in DevTools by default.

您可以通过在Mac上按cmd + opt + j或在Windows中按ctrl + shift + j来查看“ network标签。 默认情况下,它将在DevTools中打开console选项卡。

Once the console tab is open, simply click on the network tab to make it visible.

打开console选项卡后,只需单击network选项卡使其可见。

Once the network tab is open we can begin our tutorial.

打开network标签后,我们就可以开始我们的教程了。

让我们开始 (Let's begin)

Make sure the correct page is open (freecodecamp.org/news) and the "network" tab panel is open in DevTools:

确保打开了正确的页面( freecodecamp.org/news ),并且在DevTools中打开了“网络”标签面板:

  • The green box here illustrates the icon that can hide/show the filter area in the network panel tab.此处的绿色框说明了可以隐藏/显示“网络面板”选项卡中的过滤器区域的图标。
  • The red box here illustrates the filter area box. With this box we can filter out network requests.这里的红色框说明了过滤区域框。 使用此框,我们可以过滤出网络请求。

通过文字查找网络请求 (Find network request by text)

Type analytics into the Filter text box. Only the files that contain the text analytics are shown.

在过滤器文本框中输入analytics 。 仅显示包含文本analytics的文件。

通过正则表达式查找网络请求 (Find network request by regex expression)

Type /.*\min.[c]s+$/. DevTools filters out any resources with filenames that end with a min.c followed by 1 or more s characters.

/.*\min.[c]s+$/ 。 DevTools过滤掉所有文件名以min.c结尾且后跟1个或多个s字符的资源。

过滤(排除)网络请求 (Filter (exclude) out network request)

Type -min.js. DevTools filters out all files that contain min.js. If any other file matches the pattern they will also be filtered out and won't be visible in the network panel.

-min.js DevTools过滤掉包含min.js所有文件。 如果任何其他文件与该模式匹配,它们也将被过滤掉,并且在网络面板中将不可见。

使用属性过滤器查看特定域的网络请求 (Use property filter to see network request by a certain domain)

Type domain:code.jquery.com into the filter area. It will only show network requests that belong to the URL code.jquery.com.

在过滤器区域中输入domain:code.jquery.com 。 它只会显示属于URL code.jquery.com网络请求。

按资源类型查找网络请求 (Find network request by resource type)

If you only want to see which font(s) file is being used on a certain page click Font:

如果您只想查看特定页面上正在使用哪种字体文件,请点击Font

Or if you only want to see the web socket files being loaded on a certain page click WS:

或者,如果您只想查看特定页面上正在加载的Web套接字文件,请单击WS

You can also go one step further and view both Font & WS files together. Simply click on Font first and then cmd click on WS to multi-select tabs. (If you are on a Windows machine you can multi-select by using ctrl click).

您还可以更进一步,一起查看FontWS文件。 只需先单击“ Font ,然后cmd单击WS以多选选项卡。 (如果您在Windows计算机上,则可以使用ctrl单击来进行多选)。



That is it for this tutorial. If you found it useful do share it with your colleagues and let me know what you think as well on twitter.com/adeelibr.

本教程就是这样。 如果您发现它有用,请与您的同事分享,并在twitter.com/adeelibr上告诉我您的想法

翻译自: https://www.freecodecamp.org/news/chrome-devtools-network-tab-tricks/

Chrome DevTools:如何过滤网络请求相关推荐

  1. Charles抓包工具过滤网络请求

    Charles是一个HTTP代理服务器,HTTP监视器,反转代理服务器,当浏览器连接Charles的代理访问互联网时,Charles可以监控浏览器发送和接收的所有数据.它允许一个开发者查看所有连接互联 ...

  2. Chrome开发者工具关于网络请求的一个隐藏技能

    这个隐藏技能的背景是,最近出于学习目的,我写了一个百度贴吧的网络爬虫,专门爬取一些指定主题的贴吧帖子. 抓取帖子用的JavaScript函数如下: function getPostByAJAX(req ...

  3. Chrome开发者工具关于网络请求的一个隐藏技能 1

    这个隐藏技能的背景是,最近出于学习目的,我写了一个百度贴吧的网络爬虫,专门爬取一些指定主题的贴吧帖子. 抓取帖子用的JavaScript函数如下: function getPostByAJAX(req ...

  4. chrome开发者工具网络请求过滤

    前言 chrome开发者工具,会列出所有的网络请求,网络请求太多的时候,如何准确过滤出我们需要的网路请求呢? 我们以 www.aliyun.com/ 网址为例,一起来看看五种过滤方式. 文本过滤 比如 ...

  5. Chrome DevTools 之 Network,网络加载分析利器

    虽然一直在用Chrome DevTools,但大多停留在常用的功能和调试上,比如Elements/Network/Sources/Console等主要功能,而对于性能分析/优化相关的Timeline/ ...

  6. 使用 Chrome DevTools 模拟缓慢的 3G 网络速度

    转自:Simulate slow 3G network speed with Chrome DevTools 有时我们可能想测试测试弱网环境下各种操作能否正常被执行或者是否有异常报错提示.但是当今世界 ...

  7. Selenium Chrome 查看网络请求

    通过selenium的Chrome查看网络请求,包含Ajax.图片.CSS等,需要开启performance. import json from selenium import webdriver f ...

  8. chrome 94版本默认开启阻止不安全的专用网络请求

    背景 据悉,谷歌 Chrome 浏览器已改为四周一大更.9月22号,Chrome 94 已正式发布.Chrome 94 默认开启"阻止不安全的专用网络请求",将使得http的站点请 ...

  9. 利用Chrome网络请求调试页面跳转问题

    背景 现在大量的信息系统都是基于WEB服务,这些WEB服务糅合了单点登录.权限控制.网关.代理等多种技术手段,当请求一个页面时,发现它跳转的目标竟然让人匪夷所思,完全不是意想中的样子.怎样捕捉这些跳转 ...

最新文章

  1. iOS 相册相机应用2
  2. python自动化测试-D8-学习笔记之一(面向对象编程)
  3. pytorch中的pre-train函数模型引用及修改(增减网络层,修改某层参数等)
  4. uva 11997 K Smallest Sums 优先队列处理多路归并问题
  5. 看不起胖子?自如员工爆料身高、体重决定能否晋升,官方回应侧面实锤?
  6. java程序的界面编程详解
  7. Forget Yourself
  8. 下载编译LineageOS代码
  9. Spark机器学习-LDA算法09
  10. 【Visio】 windows Visio 画图
  11. java冻结jsp首行_如何实现表格的首行冻结2
  12. 美国拉斯维加斯游戏CRAPS(花旗骰)掷骰子的游戏的C语言版本
  13. 和领导相处的10条法则,越早知道越好
  14. harbor1.9.1搭建
  15. matlab gui双音拨号,用matlab GUI功能模拟DTMF拨号系统.doc
  16. excel文档加密破解,简单操作亲测有效
  17. vue 跳转路由后返回上一页还是当前页面,但是路由地址有改变(已解决)
  18. 苹果macOS Big Sur 11.4 正式版发布
  19. CGB2108day17
  20. React中文文档之Rendering Elements

热门文章

  1. 【今日CV 计算机视觉论文速览 第120期】Thu, 23 May 2019
  2. python-字符串数据类型-0222
  3. mysql数据表的创建-数据类型
  4. python-运算符-比较运算符
  5. 使用pip安装包提示TLS证书错误解决办法
  6. Xcode 9.0 beta 3 GPUImage崩溃问题(presentBufferForDisplay)
  7. linux文件目录与管理
  8. java基础----数据类型转化
  9. 一起Polyfill系列:让Date识别ISO 8601日期时间格式
  10. 安装Vistual Studio 2005的小问题