diff --git a/src/core/drive/visit.js b/src/core/drive/visit.js index 6cf1b52c7..6a93a1e45 100644 --- a/src/core/drive/visit.js +++ b/src/core/drive/visit.js @@ -159,7 +159,7 @@ export class Visit { this.simulateRequest() } else if (!this.request && await this.shouldIssueRequest()) { this.request = new FetchRequest(this, FetchMethod.get, this.location) - this.request.perform() + await this.request.perform() } } diff --git a/src/core/frames/frame_controller.js b/src/core/frames/frame_controller.js index 1cab2902e..7047ea2d7 100644 --- a/src/core/frames/frame_controller.js +++ b/src/core/frames/frame_controller.js @@ -321,7 +321,7 @@ export class FrameController { } } - async #visit(url) { + #visit(url) { const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element) this.#currentFetchRequest?.cancel() @@ -333,7 +333,7 @@ export class FrameController { this.#currentFetchRequest = null resolve() } - request.perform() + return request.perform() }) } diff --git a/src/http/fetch_request.js b/src/http/fetch_request.js index 9b61b8b49..9b5513b7e 100644 --- a/src/http/fetch_request.js +++ b/src/http/fetch_request.js @@ -124,7 +124,7 @@ export class FetchRequest { try { this.delegate.requestStarted(this) const response = await fetch(this.url.href, fetchOptions) - return await this.receive(response) + return this.receive(response) } catch (error) { if (error.name !== "AbortError") { if (this.#willDelegateErrorHandling(error)) { @@ -147,9 +147,9 @@ export class FetchRequest { if (event.defaultPrevented) { this.delegate.requestPreventedHandlingResponse(this, fetchResponse) } else if (fetchResponse.succeeded) { - this.delegate.requestSucceededWithResponse(this, fetchResponse) + await this.delegate.requestSucceededWithResponse(this, fetchResponse) } else { - this.delegate.requestFailedWithResponse(this, fetchResponse) + await this.delegate.requestFailedWithResponse(this, fetchResponse) } return fetchResponse }