diff --git a/src/dispatchers/browserContextDispatcher.ts b/src/dispatchers/browserContextDispatcher.ts index 740ed0c275698..94e5d2fff0475 100644 --- a/src/dispatchers/browserContextDispatcher.ts +++ b/src/dispatchers/browserContextDispatcher.ts @@ -114,7 +114,7 @@ export class BrowserContextDispatcher extends Dispatcher { + await this._context._setRequestInterceptor((route, request) => { this._dispatchEvent('route', { route: new RouteDispatcher(this._scope, route), request: RequestDispatcher.from(this._scope, request) }); }); } diff --git a/src/dispatchers/pageDispatcher.ts b/src/dispatchers/pageDispatcher.ts index 9ec902ae1443a..6f8087e4f1207 100644 --- a/src/dispatchers/pageDispatcher.ts +++ b/src/dispatchers/pageDispatcher.ts @@ -136,7 +136,7 @@ export class PageDispatcher extends Dispatcher i await this._page._setClientRequestInterceptor(undefined); return; } - this._page._setClientRequestInterceptor((route, request) => { + await this._page._setClientRequestInterceptor((route, request) => { this._dispatchEvent('route', { route: new RouteDispatcher(this._scope, route), request: RequestDispatcher.from(this._scope, request) }); }); }