Resources are all network assets loaded to render a page, including CSS, Javascript, Fonts, Web Sockets, XHR/Fetch Requests, and more.
The Resource class is returned from window.waitForResource calls. It is used to dynamically load portions of a Resource on demand.
If an obtained Resource is a Websocket, a WebsocketResource is returned.
Retrieve the network request used to retrieve this resource.
ResourceRequestRetrieve the network request used to retrieve this resource.
ResourceResponseThe requested url
The document (if applicable) that requested this resource.
stringstringThe type of resource. Possible values are:
Document, Redirect, Websocket, Ico, Preflight, Script, Stylesheet, Xhr, Fetch, Image, Media, Font, Text Track, Event Source, Manifest, Signed Exchange, Ping, CSP Violation Report, Other
ResourceTypeWas this request redirected
booleanLoad the underlying buffer returned by this network response.
Promise<Buffer>Convert the returned resource body to a string.
Promise<string>Convert the returned resource body into json.
Promise<json>