summaryrefslogtreecommitdiffstats
path: root/toolkit/components/webextensions/schemas/web_navigation.json
blob: 1e13b181ace6ee79b055203eabadec0158d0de59 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
// 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": "manifest",
    "types": [
      {
        "$extend": "Permission",
        "choices": [{
          "type": "string",
          "enum": [
            "webNavigation"
          ]
        }]
      }
    ]
  },
  {
    "namespace": "webNavigation",
    "description": "Use the <code>browser.webNavigation</code> API to receive notifications about the status of navigation requests in-flight.",
    "permissions": ["webNavigation"],
    "types": [
      {
        "id": "TransitionType",
        "type": "string",
        "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"],
        "description": "Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the $(topic:transition_types)[history API] except with <code>\"start_page\"</code> in place of <code>\"auto_toplevel\"</code> (for backwards compatibility)."
      },
      {
        "id": "TransitionQualifier",
        "type": "string",
        "enum": ["client_redirect", "server_redirect", "forward_back", "from_address_bar"]
      },
      {
        "id": "EventUrlFilters",
        "type": "object",
        "properties": {
          "url": {
            "type": "array",
            "minItems": 1,
            "items": { "$ref": "events.UrlFilter" }
          }
        }
      }
    ],
    "functions": [
      {
        "name": "getFrame",
        "type": "function",
        "description": "Retrieves information about the given frame. A frame refers to an &lt;iframe&gt; or a &lt;frame&gt; of a web page and is identified by a tab ID and a frame ID.",
        "async": "callback",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "description": "Information about the frame to retrieve information about.",
            "properties": {
              "tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab in which the frame is." },
              "processId": {"optional": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": { "type": "integer", "minimum": 0, "description": "The ID of the frame in the given tab." }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "type": "object",
                "name": "details",
                "optional": true,
                "description": "Information about the requested frame, null if the specified frame ID and/or tab ID are invalid.",
                "properties": {
                  "errorOccurred": {
                    "unsupported": true,
                    "type": "boolean",
                    "description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
                  },
                  "url": {
                    "type": "string",
                    "description": "The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists."
                  },
                  "parentFrameId": {
                    "type": "integer",
                    "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
                  }
                }
              }
            ]
          }
        ]
      },
      {
        "name": "getAllFrames",
        "type": "function",
        "description": "Retrieves information about all frames of a given tab.",
        "async": "callback",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "description": "Information about the tab to retrieve all frames from.",
            "properties": {
              "tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab." }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "details",
                "type": "array",
                "description": "A list of frames in the given tab, null if the specified tab ID is invalid.",
                "optional": true,
                "items": {
                  "type": "object",
                  "properties": {
                    "errorOccurred": {
                      "unsupported": true,
                      "type": "boolean",
                      "description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
                    },
                    "processId": {
                      "unsupported": true,
                      "type": "integer",
                      "description": "The ID of the process runs the renderer for this tab."
                    },
                    "frameId": {
                      "type": "integer",
                      "description": "The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe."
                    },
                    "parentFrameId": {
                      "type": "integer",
                      "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
                    },
                    "url": {
                      "type": "string",
                      "description": "The URL currently associated with this frame."
                    }
                  }
                }
              }
            ]
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onBeforeNavigate",
        "type": "function",
        "description": "Fired when a navigation is about to occur.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation is about to occur."},
              "url": {"type": "string"},
              "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process."},
              "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."},
              "timeStamp": {"type": "number", "description": "The time when the browser was about to start the navigation, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      },
      {
        "name": "onCommitted",
        "type": "function",
        "description": "Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
              "url": {"type": "string"},
              "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
              "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
              "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
              "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      },
      {
        "name": "onDOMContentLoaded",
        "type": "function",
        "description": "Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
              "url": {"type": "string"},
              "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
              "timeStamp": {"type": "number", "description": "The time when the page's DOM was fully constructed, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      },
      {
        "name": "onCompleted",
        "type": "function",
        "description": "Fired when a document, including the resources it refers to, is completely loaded and initialized.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
              "url": {"type": "string"},
              "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
              "timeStamp": {"type": "number", "description": "The time when the document finished loading, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      },
      {
        "name": "onErrorOccurred",
        "type": "function",
        "description": "Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
              "url": {"type": "string"},
              "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
              "error": {"unsupported": true, "type": "string", "description": "The error description."},
              "timeStamp": {"type": "number", "description": "The time when the error occurred, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      },
      {
        "name": "onCreatedNavigationTarget",
        "unsupported": true,
        "type": "function",
        "description": "Fired when a new window, or a new tab in an existing window, is created to host a navigation.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "sourceTabId": {"type": "integer", "description": "The ID of the tab in which the navigation is triggered."},
              "sourceProcessId": {"type": "integer", "description": "The ID of the process runs the renderer for the source tab."},
              "sourceFrameId": {"type": "integer", "description": "The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame."},
              "url": {"type": "string", "description": "The URL to be opened in the new window."},
              "tabId": {"type": "integer", "description": "The ID of the tab in which the url is opened"},
              "timeStamp": {"type": "number", "description": "The time when the browser was about to create a new view, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      },
      {
        "name": "onReferenceFragmentUpdated",
        "type": "function",
        "description": "Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
              "url": {"type": "string"},
              "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
              "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
              "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
              "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      },
      {
        "name": "onTabReplaced",
        "type": "function",
        "description": "Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "replacedTabId": {"type": "integer", "description": "The ID of the tab that was replaced."},
              "tabId": {"type": "integer", "description": "The ID of the tab that replaced the old tab."},
              "timeStamp": {"type": "number", "description": "The time when the replacement happened, in milliseconds since the epoch."}
            }
          }
        ]
      },
      {
        "name": "onHistoryStateUpdated",
        "type": "function",
        "description": "Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
              "url": {"type": "string"},
              "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
              "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
              "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
              "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
              "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
            }
          }
        ],
        "extraParameters": [
          {
            "name": "filters",
            "optional": true,
            "$ref": "EventUrlFilters",
            "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
          }
        ]
      }
    ]
  }
]