webRequest.ResourceType

This type is a string, which represents a particular kind of resource fetched in a web request.

It's used to filter the requests you listen to using the webRequest API. For example: you can listen to requests only for images, or only for scripts.

Type

Values of this type are strings. Possible values are:

"main_frame"
"sub_frame"
"stylesheet"
"script"
"image"
"object"
"object_subrequest": a request made by a plugin
"xmlhttprequest"
"xbl"
"xslt"
"ping"
"beacon"
"xml_dtd"
"font"
"media"
"websocket"
"csp_report"
"imageset"
"web_manifest"
"other"

Browser compatibility

ChromeEdgeFirefoxFirefox for AndroidOpera
Basic support44No454831
ping49 1No454836 1
font49No454836
media58No454845
websocket58No454845
csp_report58No454845
xblNoNo4548No
xsltNoNo4548No
beaconNoNo4548No
xml_dtdNoNo4548No
imagesetNoNo4548No
web_manifestNoNo4548No
object_subrequestNoNo55 255 2No
1. Requests sent by navigator.sendBeacon(), and CSP reports in Chrome 49-57 (Opera 36-44), are also labeled as `ping`.
2. Requests have been reported as `object_subrequest` before, but the type was missing in the `ResourceType` object before Firefox 55.

Acknowledgements

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

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

 Contributors to this page: wbamberg, Wladimir_Palant, rolfedh
 Last updated by: wbamberg,