Define filter argument type for WebRequest methods

This commit is contained in:
Milan Burda 2017-04-10 02:18:36 +02:00
parent 8f46137fda
commit fa0de5c2b4

View file

@ -42,6 +42,8 @@ The following methods are available on instances of `WebRequest`:
#### `webRequest.onBeforeRequest([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
* `details` Object
* `id` Integer
@ -66,6 +68,8 @@ The `callback` has to be called with an `response` object.
#### `webRequest.onBeforeSendHeaders([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
The `listener` will be called with `listener(details, callback)` before sending
@ -90,6 +94,8 @@ The `callback` has to be called with an `response` object.
#### `webRequest.onSendHeaders([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
* `details` Object
* `id` Integer
@ -106,6 +112,8 @@ response are visible by the time this listener is fired.
#### `webRequest.onHeadersReceived([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
The `listener` will be called with `listener(details, callback)` when HTTP
@ -134,6 +142,8 @@ The `callback` has to be called with an `response` object.
#### `webRequest.onResponseStarted([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
* `details` Object
* `id` Integer
@ -154,6 +164,8 @@ and response headers are available.
#### `webRequest.onBeforeRedirect([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
* `details` Object
* `id` String
@ -174,6 +186,8 @@ redirect is about to occur.
#### `webRequest.onCompleted([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
* `details` Object
* `id` Integer
@ -192,6 +206,8 @@ completed.
#### `webRequest.onErrorOccurred([filter, ]listener)`
* `filter` Object
* `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns.
* `listener` Function
* `details` Object
* `id` Integer