| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [ | 5 [ |
| 6 { | 6 { |
| 7 "namespace": "webRequest", | 7 "namespace": "webRequest", |
| 8 "properties": { |
| 9 "MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES": { |
| 10 "value": 20, |
| 11 "description": "The maximum number of times that <code>handlerBehaviorCh
anged</code> can be called per 10 minute sustained interval. <code>handlerBehavi
orChanged</code> is an expensive function call that shouldn't be called often." |
| 12 } |
| 13 }, |
| 8 "types": [ | 14 "types": [ |
| 9 { | 15 { |
| 10 "id": "RequestFilter", | 16 "id": "RequestFilter", |
| 11 "type": "object", | 17 "type": "object", |
| 12 "description": "An object describing filters to apply to webRequest even
ts.", | 18 "description": "An object describing filters to apply to webRequest even
ts.", |
| 13 "properties": { | 19 "properties": { |
| 14 "urls": { | 20 "urls": { |
| 15 "type": "array", | 21 "type": "array", |
| 16 "description": "A list of URLs or URL patterns. Requests that cannot
match any of the URLs will be filtered out.", | 22 "description": "A list of URLs or URL patterns. Requests that cannot
match any of the URLs will be filtered out.", |
| 17 "items": { "type": "string" } | 23 "items": { "type": "string" } |
| 18 }, | 24 }, |
| 19 "types": { | 25 "types": { |
| 20 "type": "array", | 26 "type": "array", |
| 21 "optional": true, | 27 "optional": true, |
| 22 "description": "A list of request types. Requests that cannot match
any of the types will be filtered out.", | 28 "description": "A list of request types. Requests that cannot match
any of the types will be filtered out.", |
| 23 "items": { "type": "string", "enum": ["main_frame", "sub_frame", "st
ylesheet", "script", "image", "object", "xmlhttprequest", "other"] } | 29 "items": { "type": "string", "enum": ["main_frame", "sub_frame", "st
ylesheet", "script", "image", "object", "xmlhttprequest", "other"] } |
| 24 }, | 30 }, |
| 25 "tabId": { "type": "integer", "optional": true }, | 31 "tabId": { "type": "integer", "optional": true }, |
| 26 "windowId": { "type": "integer", "optional": true } | 32 "windowId": { "type": "integer", "optional": true } |
| 27 } | 33 } |
| 28 }, | 34 }, |
| 29 { | 35 { |
| 30 "id": "HttpHeaders", | 36 "id": "HttpHeaders", |
| 37 "nocompile": true, |
| 31 "type": "array", | 38 "type": "array", |
| 32 "description": "An array of HTTP headers. Each header is represented as
a dictionary containing the keys <code>name</code> and either <code>value</code>
or <code>binaryValue</code>.", | 39 "description": "An array of HTTP headers. Each header is represented as
a dictionary containing the keys <code>name</code> and either <code>value</code>
or <code>binaryValue</code>.", |
| 33 "items": { | 40 "items": { |
| 34 "type": "object", | 41 "type": "object", |
| 35 "properties": { | 42 "properties": { |
| 36 "name": {"type": "string", "description": "Name of the HTTP header."
}, | 43 "name": {"type": "string", "description": "Name of the HTTP header."
}, |
| 37 "value": {"type": "string", "optional": true, "description": "Value
of the HTTP header if it can be represented by UTF-8."}, | 44 "value": {"type": "string", "optional": true, "description": "Value
of the HTTP header if it can be represented by UTF-8."}, |
| 38 "binaryValue": { | 45 "binaryValue": { |
| 39 "type": "array", | 46 "type": "array", |
| 40 "optional": true, | 47 "optional": true, |
| 41 "description": "Value of the HTTP header if it cannot be represent
ed by UTF-8, stored as individual byte values (0..255).", | 48 "description": "Value of the HTTP header if it cannot be represent
ed by UTF-8, stored as individual byte values (0..255).", |
| 42 "items": {"type": "integer"} | 49 "items": {"type": "integer"} |
| 43 } | 50 } |
| 44 } | 51 } |
| 45 } | 52 } |
| 46 }, | 53 }, |
| 47 { | 54 { |
| 48 "id": "BlockingResponse", | 55 "id": "BlockingResponse", |
| 56 "nocompile": true, |
| 49 "type": "object", | 57 "type": "object", |
| 50 "description": "Returns value for event handlers that have the 'blocking
' extraInfoSpec applied. Allows the event handler to modify network requests.", | 58 "description": "Returns value for event handlers that have the 'blocking
' extraInfoSpec applied. Allows the event handler to modify network requests.", |
| 51 "properties": { | 59 "properties": { |
| 52 "cancel": { | 60 "cancel": { |
| 53 "type": "boolean", | 61 "type": "boolean", |
| 54 "optional": true, | 62 "optional": true, |
| 55 "description": "If true, the request is cancelled. Used in onBeforeR
equest, this prevents the request from being sent." | 63 "description": "If true, the request is cancelled. Used in onBeforeR
equest, this prevents the request from being sent." |
| 56 }, | 64 }, |
| 57 "redirectUrl": { | 65 "redirectUrl": { |
| 58 "type": "string", | 66 "type": "string", |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 138 } |
| 131 ], | 139 ], |
| 132 "returns": { | 140 "returns": { |
| 133 "$ref": "BlockingResponse", | 141 "$ref": "BlockingResponse", |
| 134 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", | 142 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", |
| 135 "optional": true | 143 "optional": true |
| 136 } | 144 } |
| 137 }, | 145 }, |
| 138 { | 146 { |
| 139 "name": "onBeforeSendHeaders", | 147 "name": "onBeforeSendHeaders", |
| 148 "nocompile": true, |
| 140 "type": "function", | 149 "type": "function", |
| 141 "description": "Fired before sending an HTTP request, once the request h
eaders are available. This may occur after a TCP connection is made to the serve
r, but before any HTTP data is sent. ", | 150 "description": "Fired before sending an HTTP request, once the request h
eaders are available. This may occur after a TCP connection is made to the serve
r, but before any HTTP data is sent. ", |
| 142 "parameters": [ | 151 "parameters": [ |
| 143 { | 152 { |
| 144 "type": "object", | 153 "type": "object", |
| 145 "name": "details", | 154 "name": "details", |
| 146 "properties": { | 155 "properties": { |
| 147 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, | 156 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, |
| 148 "url": {"type": "string"}, | 157 "url": {"type": "string"}, |
| 149 "method": {"type": "string", "description": "Standard HTTP method.
"}, | 158 "method": {"type": "string", "description": "Standard HTTP method.
"}, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 174 } | 183 } |
| 175 ], | 184 ], |
| 176 "returns": { | 185 "returns": { |
| 177 "$ref": "BlockingResponse", | 186 "$ref": "BlockingResponse", |
| 178 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", | 187 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", |
| 179 "optional": true | 188 "optional": true |
| 180 } | 189 } |
| 181 }, | 190 }, |
| 182 { | 191 { |
| 183 "name": "onSendHeaders", | 192 "name": "onSendHeaders", |
| 193 "nocompile": true, |
| 184 "type": "function", | 194 "type": "function", |
| 185 "description": "Fired just before a request is going to be sent to the s
erver (modifications of previous onBeforeSendHeaders callbacks are visible by th
e time onSendHeaders is fired).", | 195 "description": "Fired just before a request is going to be sent to the s
erver (modifications of previous onBeforeSendHeaders callbacks are visible by th
e time onSendHeaders is fired).", |
| 186 "parameters": [ | 196 "parameters": [ |
| 187 { | 197 { |
| 188 "type": "object", | 198 "type": "object", |
| 189 "name": "details", | 199 "name": "details", |
| 190 "properties": { | 200 "properties": { |
| 191 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, | 201 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, |
| 192 "url": {"type": "string"}, | 202 "url": {"type": "string"}, |
| 193 "method": {"type": "string", "description": "Standard HTTP method.
"}, | 203 "method": {"type": "string", "description": "Standard HTTP method.
"}, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 213 "description": "Array of extra information that should be passed to
the listener function.", | 223 "description": "Array of extra information that should be passed to
the listener function.", |
| 214 "items": { | 224 "items": { |
| 215 "type": "string", | 225 "type": "string", |
| 216 "enum": ["requestHeaders"] | 226 "enum": ["requestHeaders"] |
| 217 } | 227 } |
| 218 } | 228 } |
| 219 ] | 229 ] |
| 220 }, | 230 }, |
| 221 { | 231 { |
| 222 "name": "onHeadersReceived", | 232 "name": "onHeadersReceived", |
| 233 "nocompile": true, |
| 223 "type": "function", | 234 "type": "function", |
| 224 "description": "Fired when HTTP response headers of a request have been
received.", | 235 "description": "Fired when HTTP response headers of a request have been
received.", |
| 225 "parameters": [ | 236 "parameters": [ |
| 226 { | 237 { |
| 227 "type": "object", | 238 "type": "object", |
| 228 "name": "deails", | 239 "name": "deails", |
| 229 "properties": { | 240 "properties": { |
| 230 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, | 241 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, |
| 231 "url": {"type": "string"}, | 242 "url": {"type": "string"}, |
| 232 "method": {"type": "string", "description": "Standard HTTP method.
"}, | 243 "method": {"type": "string", "description": "Standard HTTP method.
"}, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 258 } | 269 } |
| 259 ], | 270 ], |
| 260 "returns": { | 271 "returns": { |
| 261 "$ref": "BlockingResponse", | 272 "$ref": "BlockingResponse", |
| 262 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", | 273 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", |
| 263 "optional": true | 274 "optional": true |
| 264 } | 275 } |
| 265 }, | 276 }, |
| 266 { | 277 { |
| 267 "name": "onAuthRequired", | 278 "name": "onAuthRequired", |
| 279 "nocompile": true, |
| 268 "type": "function", | 280 "type": "function", |
| 269 "description": "Fired when an authentication failure is received. The li
stener has three options: it can provide authentication credentials, it can canc
el the request and display the error page, or it can take no action on the chall
enge. If bad user credentials are provided, this may be called multiple times fo
r the same request.", | 281 "description": "Fired when an authentication failure is received. The li
stener has three options: it can provide authentication credentials, it can canc
el the request and display the error page, or it can take no action on the chall
enge. If bad user credentials are provided, this may be called multiple times fo
r the same request.", |
| 270 "parameters": [ | 282 "parameters": [ |
| 271 { | 283 { |
| 272 "type": "object", | 284 "type": "object", |
| 273 "name": "details", | 285 "name": "details", |
| 274 "properties": { | 286 "properties": { |
| 275 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, | 287 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, |
| 276 "url": {"type": "string"}, | 288 "url": {"type": "string"}, |
| 277 "method": {"type": "string", "description": "Standard HTTP method.
"}, | 289 "method": {"type": "string", "description": "Standard HTTP method.
"}, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 327 } |
| 316 ], | 328 ], |
| 317 "returns": { | 329 "returns": { |
| 318 "$ref": "BlockingResponse", | 330 "$ref": "BlockingResponse", |
| 319 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", | 331 "description": "If \"blocking\" is specified in the \"extraInfoSpec\"
parameter, the event listener should return an object of this type.", |
| 320 "optional": true | 332 "optional": true |
| 321 } | 333 } |
| 322 }, | 334 }, |
| 323 { | 335 { |
| 324 "name": "onResponseStarted", | 336 "name": "onResponseStarted", |
| 337 "nocompile": true, |
| 325 "type": "function", | 338 "type": "function", |
| 326 "description": "Fired when the first byte of the response body is receiv
ed. For HTTP requests, this means that the status line and response headers are
available.", | 339 "description": "Fired when the first byte of the response body is receiv
ed. For HTTP requests, this means that the status line and response headers are
available.", |
| 327 "parameters": [ | 340 "parameters": [ |
| 328 { | 341 { |
| 329 "type": "object", | 342 "type": "object", |
| 330 "name": "details", | 343 "name": "details", |
| 331 "properties": { | 344 "properties": { |
| 332 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, | 345 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, |
| 333 "url": {"type": "string"}, | 346 "url": {"type": "string"}, |
| 334 "method": {"type": "string", "description": "Standard HTTP method.
"}, | 347 "method": {"type": "string", "description": "Standard HTTP method.
"}, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 359 "items": { | 372 "items": { |
| 360 "type": "string", | 373 "type": "string", |
| 361 "enum": ["responseHeaders"] | 374 "enum": ["responseHeaders"] |
| 362 } | 375 } |
| 363 } | 376 } |
| 364 ] | 377 ] |
| 365 }, | 378 }, |
| 366 { | 379 { |
| 367 "name": "onBeforeRedirect", | 380 "name": "onBeforeRedirect", |
| 368 "type": "function", | 381 "type": "function", |
| 382 "nocompile": true, |
| 369 "description": "Fired when a server-initiated redirect is about to occur
.", | 383 "description": "Fired when a server-initiated redirect is about to occur
.", |
| 370 "parameters": [ | 384 "parameters": [ |
| 371 { | 385 { |
| 372 "type": "object", | 386 "type": "object", |
| 373 "name": "details", | 387 "name": "details", |
| 374 "properties": { | 388 "properties": { |
| 375 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, | 389 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, |
| 376 "url": {"type": "string"}, | 390 "url": {"type": "string"}, |
| 377 "method": {"type": "string", "description": "Standard HTTP method.
"}, | 391 "method": {"type": "string", "description": "Standard HTTP method.
"}, |
| 378 "frameId": {"type": "integer", "description": "The value 0 indicat
es that the request happens in the main frame; a positive value indicates the ID
of a subframe in which the request happens. If the document of a (sub-)frame is
loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>)
, <code>frameId</code> indicates the ID of this frame, not the ID of the outer f
rame. Frame IDs are unique within a tab."}, | 392 "frameId": {"type": "integer", "description": "The value 0 indicat
es that the request happens in the main frame; a positive value indicates the ID
of a subframe in which the request happens. If the document of a (sub-)frame is
loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>)
, <code>frameId</code> indicates the ID of this frame, not the ID of the outer f
rame. Frame IDs are unique within a tab."}, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 403 "items": { | 417 "items": { |
| 404 "type": "string", | 418 "type": "string", |
| 405 "enum": ["responseHeaders"] | 419 "enum": ["responseHeaders"] |
| 406 } | 420 } |
| 407 } | 421 } |
| 408 ] | 422 ] |
| 409 }, | 423 }, |
| 410 { | 424 { |
| 411 "name": "onCompleted", | 425 "name": "onCompleted", |
| 412 "type": "function", | 426 "type": "function", |
| 427 "nocompile": true, |
| 413 "description": "Fired when a request is completed.", | 428 "description": "Fired when a request is completed.", |
| 414 "parameters": [ | 429 "parameters": [ |
| 415 { | 430 { |
| 416 "type": "object", | 431 "type": "object", |
| 417 "name": "details", | 432 "name": "details", |
| 418 "properties": { | 433 "properties": { |
| 419 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, | 434 "requestId": {"type": "string", "description": "The ID of the requ
est. Request IDs are unique within a browser session. As a result, they could be
used to relate different events of the same request."}, |
| 420 "url": {"type": "string"}, | 435 "url": {"type": "string"}, |
| 421 "method": {"type": "string", "description": "Standard HTTP method.
"}, | 436 "method": {"type": "string", "description": "Standard HTTP method.
"}, |
| 422 "frameId": {"type": "integer", "description": "The value 0 indicat
es that the request happens in the main frame; a positive value indicates the ID
of a subframe in which the request happens. If the document of a (sub-)frame is
loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>)
, <code>frameId</code> indicates the ID of this frame, not the ID of the outer f
rame. Frame IDs are unique within a tab."}, | 437 "frameId": {"type": "integer", "description": "The value 0 indicat
es that the request happens in the main frame; a positive value indicates the ID
of a subframe in which the request happens. If the document of a (sub-)frame is
loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>)
, <code>frameId</code> indicates the ID of this frame, not the ID of the outer f
rame. Frame IDs are unique within a tab."}, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 { | 492 { |
| 478 "$ref": "RequestFilter", | 493 "$ref": "RequestFilter", |
| 479 "name": "filter", | 494 "name": "filter", |
| 480 "description": "A set of filters that restricts the events that will
be sent to this listener." | 495 "description": "A set of filters that restricts the events that will
be sent to this listener." |
| 481 } | 496 } |
| 482 ] | 497 ] |
| 483 } | 498 } |
| 484 ] | 499 ] |
| 485 } | 500 } |
| 486 ] | 501 ] |
| OLD | NEW |