Chrome Dev Tools is undoubtedly a very powerful set of web developer tools, built directly into the Chrome browser that helps you with your day-to-day work on building, debugging and optimizing web applications. To launch Chrome Dev Tools you simply right click on any web page that you are working and select Inspect or press Cmd+Alt+I on a mac or Ctrl+Alt+I on a windows machine.
When the Tools become available you will notice at the top a set of panels, each one offering a unique set of features; among them is the Network panel which allows you to inspect the network activity and help you identify whether or not your app’s resources are actually being uploaded or downloaded.
Filters in Network Panel
The Network panel includes as well a set of filters that allows you to filter out resources and that becomes available when you click on the funnel icon :
Although you can click on each predefined filter, such as XHR, JS, CSS, etc., the true power of filtering lies in the small text field at the left of the Filters toolbar, where you can filter resources :
png and only files that contain this text will appear.
…by regular expressions
type /.b+$/ where only resources with a filename ending in
b will be displayed.
…by negative filter, using
-mime-type:image/png to exclude all png files.
…by other properties
here is a list of properties and some examples that you can use in your filters:
# Properties are sorted alphabetically
# Notice the `-` sign which is used as NOT or Exclude filter
# Use a * character to include multiple domains.
# ie.: *.com, domain:google.com, -domain:twitter.com
# Filter resources with the specified HTTP response header.
# ie.: has-response-header:Content-Type, has-response-header:age
# is:running finds WebSocket resources
# - is:from-cache,
# - is:service-worker-initiated
# - is:service-worker-intercepted
# Note: larger-than:1024 is equivalent to larger-than:1k
# ie.: larger-than:120, larger-than:4k, larger-than:100M
# method:POST, -method:OPTIONS, method:PUT, method:GET
# exclude Pre-flight method requests -method:OPTIONS
# ie.: mime-type:application/manifest+json, mime-type:image/x-icon
# mixed-content:all (Show all mixed-content resources)
# mixed-content:displayed (Show only those currently displayed) (never used this personally)
# ie.: scheme:http, scheme:https,
# ie.: set-cookie-domain:.google.com
# Match Set-Cookie response headers with name
# ie.: set-cookie-name:GDPR
# Match Set-Cookie response headers with value
# ie.: set-cookie-value:AISJHD98ashfa93q2rj_94w-asd-yolololo
# Match status code
# ie. status-code:200, -status-code:204
Exclude preflight (OPTIONS) requests
A very common scenario is when you want to exclude preflight requests from network activity.
When you are working on a client application, you might have a preflight request, which is a small request sent by the browser before the actual request. It contains information such as which HTTP method is used, as well as if any custom HTTP headers are present. The preflight gives the server a chance to examine what the actual request will look like before it’s made.
To filter those requests out you can select the negative filter using the
- sign before the property
method and then type an OPTIONS request type, like this:
You can also combine filters by using space
So, if you want:
- to include GET requests but exclude POST requests, you can use something like:
- or exclude both png and jpg files, you can use something like:
For more info you can visit the official page of Chrome Dev Tools for network activity