docs: fix web-request.md listener signatures in electron.d.ts (#16485)

This commit is contained in:
Milan Burda 2019-01-22 17:46:40 +01:00 committed by Michelle Tilley
parent 7d71ad6f91
commit dbc5f67dca

View file

@ -73,11 +73,6 @@ The `callback` has to be called with an `response` object.
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
The `listener` will be called with `listener(details, callback)` before sending
an HTTP request, once the request headers are available. This may occur after a
TCP connection is made to the server, but before any http data is sent.
* `details` Object * `details` Object
* `id` Integer * `id` Integer
* `url` String * `url` String
@ -92,6 +87,10 @@ TCP connection is made to the server, but before any http data is sent.
* `requestHeaders` Object (optional) - When provided, request will be made * `requestHeaders` Object (optional) - When provided, request will be made
with these headers. with these headers.
The `listener` will be called with `listener(details, callback)` before sending
an HTTP request, once the request headers are available. This may occur after a
TCP connection is made to the server, but before any http data is sent.
The `callback` has to be called with an `response` object. The `callback` has to be called with an `response` object.
#### `webRequest.onSendHeaders([filter, ]listener)` #### `webRequest.onSendHeaders([filter, ]listener)`
@ -119,10 +118,6 @@ response are visible by the time this listener is fired.
* `urls` String[] - Array of URL patterns that will be used to filter out the * `urls` String[] - Array of URL patterns that will be used to filter out the
requests that do not match the URL patterns. requests that do not match the URL patterns.
* `listener` Function * `listener` Function
The `listener` will be called with `listener(details, callback)` when HTTP
response headers of a request have been received.
* `details` Object * `details` Object
* `id` Integer * `id` Integer
* `url` String * `url` String
@ -142,6 +137,9 @@ response headers of a request have been received.
`responseHeaders` to change header status otherwise original response `responseHeaders` to change header status otherwise original response
header's status will be used. header's status will be used.
The `listener` will be called with `listener(details, callback)` when HTTP
response headers of a request have been received.
The `callback` has to be called with an `response` object. The `callback` has to be called with an `response` object.
#### `webRequest.onResponseStarted([filter, ]listener)` #### `webRequest.onResponseStarted([filter, ]listener)`