summaryrefslogtreecommitdiffstats
path: root/browser/components/extensions/schemas/devtools_network.json
blob: 86b64bbdf1bb910ee104c8e18b59a5cd60dce7b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

[
  {
    "namespace": "devtools.network",
    "allowedContexts": ["devtools", "devtools_only"],
    "defaultContexts": ["devtools", "devtools_only"],
    "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.",
    "types": [
      {
        "id": "Request",
        "type": "object",
        "description": "Represents a network request for a document resource (script, image and so on). See HAR Specification for reference.",
        "functions": [
          {
            "name": "getContent",
            "type": "function",
            "description": "Returns content of the response body.",
            "async": "callback",
            "parameters": [
              {
                "name": "callback",
                "type": "function",
                "description": "A function that receives the response body when the request completes.",
                "parameters": [
                  {
                    "name": "content",
                    "type": "string",
                    "description": "Content of the response body (potentially encoded)."
                  },
                  {
                    "name": "encoding",
                    "type": "string",
                    "description": "Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported."
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "functions": [
      {
        "name": "getHAR",
        "type": "function",
        "description": "Returns HAR log that contains all known network requests.",
        "async": "callback",
        "parameters": [
          {
            "name": "callback",
            "type": "function",
            "description": "A function that receives the HAR log when the request completes.",
            "parameters": [
              {
                "name": "harLog",
                "type": "object",
                "additionalProperties": { "type": "any" },
                "description": "A HAR log. See HAR specification for details."
              }
            ]
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onRequestFinished",
        "type": "function",
        "description": "Fired when a network request is finished and all request data are available.",
        "parameters": [
          {
            "name": "request",
            "$ref": "Request",
            "description": "Description of a network request in the form of a HAR entry. See HAR specification for details."
          }
        ]
      },
      {
        "name": "onNavigated",
        "type": "function",
        "description": "Fired when the inspected window navigates to a new page.",
        "parameters": [
          {
            "name": "url",
            "type": "string",
            "description": "URL of the new page."
          }
        ]
      }
    ]
  }
]