fix(firefox): disable cache for request interception

Fixes #30000
This commit is contained in:
Andrey Lushnikov 2024-03-22 17:18:06 -07:00
parent 348d0c2bfa
commit 15b9963dc6
2 changed files with 4 additions and 2 deletions

View file

@ -50,7 +50,10 @@ export class FFNetworkManager {
}
async setRequestInterception(enabled: boolean) {
await this._session.send('Network.setRequestInterception', { enabled });
await Promise.all([
this._session.send('Page.setCacheDisabled', { cacheDisabled: enabled }),
this._session.send('Network.setRequestInterception', { enabled }),
]);
}
_onRequestWillBeSent(event: Protocol.Network.requestWillBeSentPayload) {

View file

@ -350,7 +350,6 @@ it('should return body for prefetch script', async ({ page, server, browserName
it('should bypass disk cache when interception is enabled', async ({ page, server, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30000' });
it.fixme(browserName === 'firefox', 'Returns cached response.');
await page.goto(server.PREFIX + '/frames/one-frame.html');
await page.route('**/api*', route => route.continue());
{