merge with context routes
This commit is contained in:
parent
e09f3bca06
commit
6602984401
|
|
@ -421,7 +421,15 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel>
|
|||
private async _updateInterceptionPatterns() {
|
||||
const patterns = network.RouteHandler.prepareInterceptionPatterns(this._routes);
|
||||
await this._channel.setNetworkInterceptionPatterns({ patterns });
|
||||
await this._mockingProxy?.setInterceptionPatterns({ patterns });
|
||||
await this._updateMockingProxyInterceptionPatterns();
|
||||
}
|
||||
|
||||
async _updateMockingProxyInterceptionPatterns() {
|
||||
if (!this._mockingProxy)
|
||||
return;
|
||||
const pageRoutes = this.pages().flatMap(page => page._routes);
|
||||
const patterns = network.RouteHandler.prepareInterceptionPatterns(this._routes.concat(pageRoutes));
|
||||
await this._mockingProxy.setInterceptionPatterns({ patterns });
|
||||
}
|
||||
|
||||
private async _updateWebSocketInterceptionPatterns() {
|
||||
|
|
|
|||
|
|
@ -568,8 +568,7 @@ export class Page extends ChannelOwner<channels.PageChannel> implements api.Page
|
|||
private async _updateInterceptionPatterns() {
|
||||
const patterns = RouteHandler.prepareInterceptionPatterns(this._routes);
|
||||
await this._channel.setNetworkInterceptionPatterns({ patterns });
|
||||
// TODO: merge this with browserContext patterns
|
||||
await this._browserContext._mockingProxy?.setInterceptionPatterns({ patterns });
|
||||
await this._browserContext._updateMockingProxyInterceptionPatterns();
|
||||
}
|
||||
|
||||
private async _updateWebSocketInterceptionPatterns() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue