chore(bidi): improve request interception#39750
Open
hbenl wants to merge 1 commit intomicrosoft:mainfrom
Open
Conversation
a2e6ca5 to
5a40de9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5a40de9 to
aa97fc7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Test results for "MCP"5507 passed, 343 skipped Merge workflow run. |
Contributor
Test results for "tests 1"7 flaky38821 passed, 845 skipped Merge workflow run. |
yury-s
approved these changes
Mar 18, 2026
| import { parseRawCookie } from '../cookieStore'; | ||
| import * as network from '../network'; | ||
| import * as bidi from './third_party/bidiProtocol'; | ||
| import { BidiPage } from './bidiPage'; |
Member
There was a problem hiding this comment.
Suggested change
| import { BidiPage } from './bidiPage'; | |
| import type { BidiPage } from './bidiPage'; |
| urlPatterns: [{ type: 'pattern' }], | ||
| }); | ||
| this._interceptId = intercept; | ||
| }).then(({ intercept }) => this._interceptId = intercept); |
Member
There was a problem hiding this comment.
nit: let's unify the way send('network.addIntercept' and send('network.removeIntercept' are waited - either await both inline or assign both to the interceptPromise, so that we don't accidentally end up with unhandled promise rejection.
| ], | ||
| }); | ||
|
|
||
| await browser._browserSession.send('network.addIntercept', { phases: [bidi.Network.InterceptPhase.AuthRequired] }); |
Member
There was a problem hiding this comment.
I assume it doesn't affect performance of non-auth requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this PR:
network.authRequiredis always added so that Playwright can cancel auth requests when the test didn't set any credentialsbypassforcontext.route(), previously this was only done forpage.route()page.route()are now scoped to the page, previously they were set globallyFixes the following tests:
library/browsercontext-credentials.spec.ts:page/page-network-response.spec.ts: