| 18 | import type {HTTPResponse} from './HTTPResponse'; |
| 19 | |
| 20 | export class HTTPRequest { |
| 21 | _requestId: string; |
| 22 | _response: HTTPResponse | null = null; |
| 23 | _url: string | null = null; |
| 24 | _fromMemoryCache = false; |
| 25 | |
| 26 | #isNavigationRequest: boolean; |
| 27 | #frame: Frame | null; |
| 28 | |
| 29 | constructor(frame: Frame | null, event: RequestWillBeSentEvent) { |
| 30 | this._requestId = event.requestId; |
| 31 | this.#isNavigationRequest = |
| 32 | event.requestId === event.loaderId && event.type === 'Document'; |
| 33 | this.#frame = frame; |
| 34 | this._url = event.request.url; |
| 35 | } |
| 36 | |
| 37 | response(): HTTPResponse | null { |
| 38 | return this._response; |
| 39 | } |
| 40 | |
| 41 | frame(): Frame | null { |
| 42 | return this.#frame; |
| 43 | } |
| 44 | |
| 45 | isNavigationRequest(): boolean { |
| 46 | return this.#isNavigationRequest; |
| 47 | } |
| 48 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…