rename _request

This commit is contained in:
Simon Knott 2025-01-23 15:49:39 +01:00
parent a6bf1f4b29
commit d6bc3cf3af
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
4 changed files with 5 additions and 5 deletions

View file

@ -198,7 +198,7 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
} }
async _onRoute(route: network.Route) { async _onRoute(route: network.Route) {
route._request = this.request; route._context = this.request;
const page = route.request()._safePage(); const page = route.request()._safePage();
const routeHandlers = this._routes.slice(); const routeHandlers = this._routes.slice();
for (const routeHandler of routeHandlers) { for (const routeHandler of routeHandlers) {

View file

@ -107,7 +107,7 @@ export class MockingProxy extends ChannelOwner<channels.MockingProxyChannel> imp
} }
async _onRoute(route: network.Route) { async _onRoute(route: network.Route) {
route._request = this._requestContext; route._context = this._requestContext;
const routeHandlers = this._routes.slice(); const routeHandlers = this._routes.slice();
for (const routeHandler of routeHandlers) { for (const routeHandler of routeHandlers) {
if (!routeHandler.matches(route.request().url())) if (!routeHandler.matches(route.request().url()))

View file

@ -291,7 +291,7 @@ export class Request extends ChannelOwner<channels.RequestChannel> implements ap
export class Route extends ChannelOwner<channels.RouteChannel> implements api.Route { export class Route extends ChannelOwner<channels.RouteChannel> implements api.Route {
private _handlingPromise: ManualPromise<boolean> | null = null; private _handlingPromise: ManualPromise<boolean> | null = null;
_request!: APIRequestContext; _context!: APIRequestContext;
_didThrow: boolean = false; _didThrow: boolean = false;
static from(route: channels.RouteChannel): Route { static from(route: channels.RouteChannel): Route {
@ -339,7 +339,7 @@ export class Route extends ChannelOwner<channels.RouteChannel> implements api.Ro
async fetch(options: FallbackOverrides & { maxRedirects?: number, maxRetries?: number, timeout?: number } = {}): Promise<APIResponse> { async fetch(options: FallbackOverrides & { maxRedirects?: number, maxRetries?: number, timeout?: number } = {}): Promise<APIResponse> {
return await this._wrapApiCall(async () => { return await this._wrapApiCall(async () => {
return await this._request._innerFetch({ request: this.request(), data: options.postData, ...options }); return await this._context._innerFetch({ request: this.request(), data: options.postData, ...options });
}); });
} }

View file

@ -180,7 +180,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
} }
private async _onRoute(route: Route) { private async _onRoute(route: Route) {
route._request = this.context().request; route._context = this.context().request;
const routeHandlers = this._routes.slice(); const routeHandlers = this._routes.slice();
for (const routeHandler of routeHandlers) { for (const routeHandler of routeHandlers) {
// If the page was closed we stall all requests right away. // If the page was closed we stall all requests right away.