From 00cfedbfd88bcb1a45c2f12fe0c030a861eafd9c Mon Sep 17 00:00:00 2001 From: "trop[bot]" Date: Thu, 28 Feb 2019 13:20:18 -0800 Subject: [PATCH] docs: Fix types and missing property in WebRequest APIs (backport: 5-0-x) (#17167) * docs: Fixed hook methods of WebRequest accepts null as listener * docs: Added missing `referrer` property in OnBeforeRequestDetails * docs: Add `referrer` to each webRequest responses --- docs/api/web-request.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/api/web-request.md b/docs/api/web-request.md index 920ba8758da04..d255bf43ed384 100644 --- a/docs/api/web-request.md +++ b/docs/api/web-request.md @@ -45,13 +45,14 @@ The following methods are available on instances of `WebRequest`: * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String * `method` String * `webContentsId` Integer (optional) * `resourceType` String + * `referrer` String * `timestamp` Double * `uploadData` [UploadData[]](structures/upload-data.md) * `callback` Function @@ -72,13 +73,14 @@ The `callback` has to be called with an `response` object. * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String * `method` String * `webContentsId` Integer (optional) * `resourceType` String + * `referrer` String * `timestamp` Double * `requestHeaders` Object * `callback` Function @@ -98,13 +100,14 @@ The `callback` has to be called with an `response` object. * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String * `method` String * `webContentsId` Integer (optional) * `resourceType` String + * `referrer` String * `timestamp` Double * `requestHeaders` Object @@ -117,13 +120,14 @@ response are visible by the time this listener is fired. * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String * `method` String * `webContentsId` Integer (optional) * `resourceType` String + * `referrer` String * `timestamp` Double * `statusLine` String * `statusCode` Integer @@ -147,13 +151,14 @@ The `callback` has to be called with an `response` object. * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String * `method` String * `webContentsId` Integer (optional) * `resourceType` String + * `referrer` String * `timestamp` Double * `responseHeaders` Object * `fromCache` Boolean - Indicates whether the response was fetched from disk @@ -170,13 +175,14 @@ and response headers are available. * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String * `method` String * `webContentsId` Integer (optional) * `resourceType` String + * `referrer` String * `timestamp` Double * `redirectURL` String * `statusCode` Integer @@ -193,7 +199,7 @@ redirect is about to occur. * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String @@ -215,13 +221,14 @@ completed. * `filter` Object (optional) * `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. -* `listener` Function +* `listener` Function | null * `details` Object * `id` Integer * `url` String * `method` String * `webContentsId` Integer (optional) * `resourceType` String + * `referrer` String * `timestamp` Double * `fromCache` Boolean * `error` String - The error description.