• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5[
6  {
7    "namespace": "devtools.network",
8    "description": "Use the <code>chrome.devtools.network</code> API to retrieve the information about network requests displayed by the Developer Tools in the Network panel.",
9    "nocompile": true,
10    "types": [
11      {
12        "id": "Request",
13        "type": "object",
14        "description": "Represents a network request for a document resource (script, image and so on). See HAR Specification for reference.",
15        "functions": [
16          {
17            "name": "getContent",
18            "type": "function",
19            "description": "Returns content of the response body.",
20            "parameters": [
21              {
22                "name": "callback",
23                "type": "function",
24                "description": "A function that receives the response body when the request completes.",
25                "parameters": [
26                  {
27                    "name": "content",
28                    "type": "string",
29                    "description": "Content of the response body (potentially encoded)."
30                  },
31                  {
32                    "name": "encoding",
33                    "type": "string",
34                    "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported."
35                  }
36                ]
37              }
38            ]
39          }
40        ]
41      }
42    ],
43    "functions": [
44      {
45        "name": "getHAR",
46        "type": "function",
47        "description": "Returns HAR log that contains all known network requests.",
48        "parameters": [
49          {
50            "name": "callback",
51            "type": "function",
52            "description": "A function that receives the HAR log when the request completes.",
53            "parameters": [
54              {
55                "name": "harLog",
56                "type": "object",
57                "additionalProperties": {"type": "any"},
58                "description": "A HAR log. See HAR specification for details."
59              }
60            ]
61          }
62        ]
63      }
64    ],
65    "events": [
66      {
67        "name": "onRequestFinished",
68        "type": "function",
69        "description": "Fired when a network request is finished and all request data are available.",
70        "parameters": [
71          { "name": "request", "$ref": "Request", "description": "Description of a network request in the form of a HAR entry. See HAR specification for details." }
72        ]
73      },
74      {
75        "name": "onNavigated",
76        "type": "function",
77        "description": "Fired when the inspected window navigates to a new page.",
78        "parameters": [
79          {
80            "name": "url",
81            "type": "string",
82            "description": "URL of the new page."
83          }
84        ]
85      }
86    ]
87  }
88]
89