From 53386914e188715f66fa586617fa73ba97ea0290 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 8 Jul 2021 09:20:08 +0200 Subject: [PATCH] docs: move webRequest filters definition to structures/web-request-filter.md (#29900) --- docs/api/structures/web-request-filter.md | 3 +++ docs/api/web-request.md | 32 ++++++----------------- filenames.auto.gni | 1 + 3 files changed, 12 insertions(+), 24 deletions(-) create mode 100644 docs/api/structures/web-request-filter.md diff --git a/docs/api/structures/web-request-filter.md b/docs/api/structures/web-request-filter.md new file mode 100644 index 000000000000..13d6ad30b9bd --- /dev/null +++ b/docs/api/structures/web-request-filter.md @@ -0,0 +1,3 @@ +# WebRequestFilter Object + +* `urls` String[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns. diff --git a/docs/api/web-request.md b/docs/api/web-request.md index fa1039b5e862..7edd45fb2d59 100644 --- a/docs/api/web-request.md +++ b/docs/api/web-request.md @@ -43,9 +43,7 @@ The following methods are available on instances of `WebRequest`: #### `webRequest.onBeforeRequest([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer @@ -88,9 +86,7 @@ Some examples of valid `urls`: #### `webRequest.onBeforeSendHeaders([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer @@ -117,9 +113,7 @@ The `callback` has to be called with a `response` object. #### `webRequest.onSendHeaders([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer @@ -139,9 +133,7 @@ response are visible by the time this listener is fired. #### `webRequest.onHeadersReceived([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer @@ -172,9 +164,7 @@ The `callback` has to be called with a `response` object. #### `webRequest.onResponseStarted([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer @@ -198,9 +188,7 @@ and response headers are available. #### `webRequest.onBeforeRedirect([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer @@ -225,9 +213,7 @@ redirect is about to occur. #### `webRequest.onCompleted([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer @@ -250,9 +236,7 @@ completed. #### `webRequest.onErrorOccurred([filter, ]listener)` -* `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. +* `filter` [WebRequestFilter](structures/web-request-filter.md) (optional) * `listener` Function | null * `details` Object * `id` Integer diff --git a/filenames.auto.gni b/filenames.auto.gni index 0de22fca09fb..5042ba23b493 100644 --- a/filenames.auto.gni +++ b/filenames.auto.gni @@ -128,6 +128,7 @@ auto_filenames = { "docs/api/structures/upload-file.md", "docs/api/structures/upload-raw-data.md", "docs/api/structures/user-default-types.md", + "docs/api/structures/web-request-filter.md", "docs/api/structures/web-source.md", ]