MDN self-hosted library · e01.org

webRequest.RequestFilter

An object describing filters to apply to webRequest events.

no runnable cells webextension-api-type upstream source

An object describing filters to apply to webRequest events.

Type

Values of this type are objects. They contain the following properties:

  • urls
  • : array of string. An array of match patterns. The listener will only be called for requests whose targets match any of the given patterns. Only requests made using HTTP or HTTPS will trigger events, other protocols (such as data: and file:) supported by pattern matching do not trigger events. view-source: requests may be matched based on its inner URL.
  • types
  • : array of webRequest.ResourceType. A list of resource types (for example, stylesheets, images, scripts). The listener will only be called for requests for resources which are one of the given types.
  • tabId
  • : integer. The listener will only be called for requests from the tab identified by this ID.
  • windowId
  • : integer. The listener will only be called for requests from the window identified by this ID.
  • incognito
  • : boolean. If provided, requests that do not match the incognito state (true or false) will be filtered out.

Browser compatibility

[!NOTE] This API is based on Chromium's chrome.webRequest API. This documentation is derived from web_request.json in the Chromium code.