webRequest.RequestFilter

webRequest 事件参数

Type

该参数值是一个对象,包括以下属性:

urls

字符串数组类型,数组内的每个字符串为模式匹配格式。当请求地址符合给定模式时,事件监听器才会响应。需注意的是,仅支持 http 和 HTTPS 协议的参数地址,其他协议即使与该给定模式匹配也不会响应。

types可选

webRequest.ResourceType 类型的数组,表示资源类型列表。例如:stylesheets、images、scripts。事件监听器仅响应出现在该指定列表的资源类型。

tabId可选

数值类型,与tab关联,事件监听器仅响应指定了该 tabId 的请求。

windowId可选

数值类型,与window关联,事件监听器仅响应指定了该windowId的请求。

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
RequestFilter
tabId
urls
view-source
windowId

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

备注: 该 API 基于 Chromium 的 chrome.webRequest API. 该文档来源于 Chromium 代码中的 web_request.json