GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

Search e01

One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.

6 results across 6 corpora for declarativeNetRequest.RuleAction.

Developer library 6

Intercept HTTP requests

Two APIs are available for intercepting HTTP requests: webRequest and declarativeNetRequest. The webRequest API intercepts requests by adding event listeners to the various stages of an HTTP request. The extension's listeners can inspect and modify requests programmatically: getting access to request and response headers and bodies, canceling requests, and redirecting them. Use `webRequest` when your extension needs

declarativeNetRequest

e and modify network requests without notifying extensions about individual network requests. ## Permissions To use this API, an extension must request the `"declarativeNetRequest"` or `"declarativeNetRequestWithHostAccess"` [permission](/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions) in its [`manifest.json`](/docs/Mozilla/Add-ons/WebExtensions/manifest.json) file. The `"declarativeNetRequest"` permi

declarativeNetRequest.Rule

the [manifest.json's `declarative_net_request` key](/docs/Mozilla/Add-ons/WebExtensions/manifest.json/declarative_net_request), or more dynamically through the declarativeNetRequest.updateDynamicRules or declarativeNetRequest.updateSessionRules methods. See [Rules](/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest#rules) on the API overview page for more information about rules. ## Type Values of this

declarativeNetRequest.RuleAction

Details of the action to take if a rule is matched, as the `action` property of a declarativeNetRequest.Rule. ## Type Values of this type are objects. They contain these properties: - `redirect` - : declarativeNetRequest.Redirect. Describes how the redirect should be performed. Only valid for redirect rules. - `requestHeaders` - : declarativeNetRequest.ModifyHeaderInfo. The request headers to modify for the

declarativeNetRequest.ModifyHeaderInfo

d in the `rule.action.requestHeaders` array or `rule.action.responseHeaders` array for rules whose [`rule.action.type`](/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/RuleAction#type_2) is "modifyHeaders". Each object describes one header modification. To modify multiple headers, multiple objects can be specified in these arrays, or across multiple rules. Matching `modifyHeaders` rules are applied in

declarativeNetRequest.Redirect

on`, backslash-escaped digits (`\1` to `\9`) are used to insert the corresponding capture groups. `\0` refers to the entire matching text. - `transform` - : declarativeNetRequest.URLTransform. The URL transformations to perform. - `url` - : A `string`. The redirect URL. Redirects to JavaScript URLs are not allowed. h2 ## Browser compatibility <!-- // Copyright 2015 The Chromium Authors. All rights reserved

JSON results · Services directory