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.
ResourceRequest
Retrieve the network request used to retrieve this resource.
ResourceResponse
The requested url
The document (if applicable) that requested this resource.
string
string
The 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
ResourceType
Was this request redirected
boolean
Load 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>