Questa traduzione è incompleta. Collabora alla traduzione di questo articolo dall’originale in lingua inglese.
The Network Monitor shows you all the network requests Firefox makes (for example, when it loads a page, or due to XMLHttpRequests), how long each request takes, and details of each request. To open the monitor select "Network" from the "Web Developer" menu (which is a submenu in the "Tools" menu on the Mac), or open the Developer Toolbox and switch to the "Network" tab.
The Network Monitor will appear at the bottom of the browser window. Reload the page to see the requests:
From Firefox 40 onwards, the Network Monitor records network requests any time the Toolbox is open, even if the Network Monitor itself is not selected. This means you can start debugging a page in, for example, the Web Console, then switch to the Network Monitor to see network activity without having to reload the page.
Network request list
By default, the Network Monitor shows a list of all the network requests made in the course of loading the page. Each request is displayed in its own row:
By default, the Network Monitor is cleared each time you navigate to a new page or reload the current page. You can override this behavior by checking "Enable persistent logs" in the Settings.
Network request fields
Each row displays:
- √: the HTTP status code returned. This is displayed as a color-coded icon:
- green circle for success (2XX codes)
- orange triangle for redirection (3XX)
- red square for errors (4XX and 5XX).
- hollow grey circle for responses that were fetched from the browser cache (Firefox 40 onwards)
- Method: the HTTP request method used.
- File: basename of the file requested.
- Domain: domain of the path requested.
- From Firefox 38, if the request used SSL/TLS and the connection had security weaknesses such as weak ciphers, you'll see a warning triangle next to the domain. You will be able to see more details about the problem in the Security tab.
- From Firefox 40, hover over the domain to see the IP address.
- Type:
Content-type
of the response. - Transferred (new in Firefox 38): the number of bytes that were actually transferred to load the resource. This will be less than Size if the resource was compressed.
- Size: the size of the resource, after any decompression.
The toolbar at the top labels these columns, and clicking the label sorts all the requests by that column.
If the file is an image, the row includes a thumbnail of the image, and hovering over the filename shows a preview in a tooltip:
Timeline
The request list also displays a timeline for the different parts of each request. Each timeline is given a horizontal position in its row relative to the other network requests, so you can see the total time taken to load the page. For more details on the color-coding used here, see the section on the Timings page.
Filtering by content type
At the bottom of the window a row of buttons enables you to filter requests by the content type of the response:
At the far right of this row is a button labeled "Clear": as you might guess, this enables you to clear the network request list.
Filtering by URL
New in Firefox 40.
Next to the row of buttons labeled by content type is a search box:
Click in here, or press Ctrl or Cmd + F, and start typing. The list of network requests will be filtered to include only requests that contain your filter string, in either the Domain or the File portions.
Context menu
Context-clicking on a row in the list displays a context menu with the following options:
- Copy URL
- Copy URL Parameters (new in Firefox 40)
- Copy POST Data (new in Firefox 40, only for POST requests)
- Copy as cURL
- Copy Request Headers (new in Firefox 40)
- Copy Response Headers (new in Firefox 40)
- Copy Response (new in Firefox 40)
- Copy Image as Data URI (only for images)
- Copy All As HAR (new in Firefox 41)
- Save All As HAR (new in Firefox 41)
- Edit and Resend
- Open in New Tab
- Start Performance Analysis for the page
Edit and Resend
This option opens an editor enabling you to edit the request's method, URL, parameters, and headers, and resend the request.
Copy as cURL
This option copies the network request to the clipboard as a cURL command, so you can execute it from a command line. The command may include the following options:
-X [METHOD] |
If the method is not GET or POST |
--data |
For URL encoded request parameters |
--data-binary |
For multipart request parameters |
--http/VERSION |
If the HTTP version is not 1.1 |
-I |
If the method is HEAD |
-H |
One for each request header. From Firefox 34, if the "Accept-Encoding" header is present, the cURL command will include |
Copy/Save All As HAR
New in Firefox 41.
These options create an HTTP Archive (HAR) for all requests listed. The HAR format enables you to export detailed information about network requests. 'Copy All As HAR' copies the data to the clipboard, 'Save All As HAR' opens a dialog allowing you to save the archive to disk.
Network request details
Clicking on a row displays a new pane in the right-hand side of the network monitor, which provides more detailed information about the request.
The tabs at the top of this pane enable you to switch between six different pages:
- Headers
- Cookies
- Params
- Response
- Timings
- Security (only for secure pages, and only from Firefox 37 onwards)
From Firefox 30 onwards, there's a sixth page that appears only if the content type is HTML, the Preview page.
Clicking the icon to the left of the tabs closes the pane and returns you to the list view.
Headers
This tab lists basic information about the request:
This includes:
- request URL
- request method
- remote IP address and port (new in Firefox 39)
- status code
- the HTTP request and response headers that were sent
- a button to edit and resend the request
You can filter the headers that are displayed:
Cookies
This tab lists full details of any cookies sent with the request or response:
As with headers, you can filter the list of cookies displayed.
Params
This tab displays the GET parameters and POST data of a request:
Response
The complete content of the response. If the response is HTML, JS, or CSS, it will be shown as text:
If the response is JSON, it will be shown as an inspectable object:
If the response is an image, the tab displays a preview:
Timings
The Timings tab has a more detailed, annotated, view of the timeline bar for that request showing how the total wait time is split into the various stages:
Preview
If the file type is HTML a sixth tab appears labeled "Preview". This renders just that HTML:
Security
New in Firefox 37.
From Firefox 37 onwards, if the site is being served over HTTPS, you get an extra tab labeled "Security". This contains details about the secure connection used including the protocol, the cipher suite, and certificate details:
From Firefox 38 onwards, the Security tab shows a warning for security weaknesses. Currently it warns you about two weaknesses:
- Using SSLv3 instead of TLS
- Using the RC4 cipher
Performance analysis
The Network Monitor includes a performance analysis tool, to help show you how long the browser takes to download the different parts of your site.
To run the performance analysis tool click the stopwatch icon in the toolbar at the bottom of the Network Monitor:
(Alternatively, if you have only just opened the Network Monitor, so it's not yet populated with the list of requests, you'll get a stopwatch icon in the main window.)
The Network Monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache. This simulates the first time a user visits your site, and subsequent visits. It displays the results for each run side by side, or vertically if the browser window is narrow:
The results for each run are summarised in a table and a pie chart. The tables group resources by type, and show the total size of each resource and the total time it took to load them. The accompanying pie chart shows the relative size of each resource type.
To get back to the Network Monitor's list of network requests click the "Back" button on the left.
Clicking on a slice of the pie takes you to the Network Monitor for that run, with a filter automatically applied to see only that resource type.