A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.chrome.com/docs/extensions/reference/devtools_network below:

chrome.devtools.network | API | Chrome for Developers

chrome.devtools.network

Stay organized with collections Save and categorize content based on your preferences.

Description

Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel.

Network requests information is represented in the HTTP Archive format (HAR). The description of HAR is outside of scope of this document, refer to HAR v1.2 Specification.

In terms of HAR, the chrome.devtools.network.getHAR() method returns entire HAR log, while chrome.devtools.network.onRequestFinished event provides HAR entry as an argument to the event callback.

Note that request content is not provided as part of HAR for efficiency reasons. You may call request's getContent() method to retrieve content.

If the Developer Tools window is opened after the page is loaded, some requests may be missing in the array of entries returned by getHAR(). Reload the page to get all requests. In general, the list of requests returned by getHAR() should match that displayed in the Network panel.

See DevTools APIs summary for general introduction to using Developer Tools APIs.

Manifest

The following keys must be declared in the manifest to use this API.

"devtools_page"
Examples

The following code logs URLs of all images larger than 40KB as they are loaded:

chrome.devtools.network.onRequestFinished.addListener(
  function(request) {
    if (request.response.bodySize > 40*1024) {
      chrome.devtools.inspectedWindow.eval(
          'console.log("Large image: " + unescape("' +
          escape(request.request.url) + '"))');
    }
  }
);

To try this API, install the devtools API examples from the chrome-extension-samples repository.

Types

Request

Represents a network request for a document resource (script, image and so on). See HAR Specification for reference.

Properties Methods

getHAR()

chrome.devtools.network.getHAR(
  callback: function,
)
: void

Returns HAR log that contains all known network requests.

Parameters Events

onNavigated

chrome.devtools.network.onNavigated.addListener(
  callback: function,
)

Fired when the inspected window navigates to a new page.

Parameters

onRequestFinished

chrome.devtools.network.onRequestFinished.addListener(
  callback: function,
)

Fired when a network request is finished and all request data are available.

Parameters

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-11 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-11 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4