cherry-pick(#34530): fix(firefox): disable fetch keep-alive for now before a proper fix (#34534)

Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
This commit is contained in:
Dmitry Gozman 2025-01-29 11:01:01 +00:00 committed by GitHub
parent 19fe83f9a1
commit 7b3e590289
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -435,4 +435,6 @@ function toJugglerProxyOptions(proxy: types.ProxySettings) {
// Prefs for quick fixes that didn't make it to the build.
// Should all be moved to `playwright.cfg`.
const kBandaidFirefoxUserPrefs = {};
const kBandaidFirefoxUserPrefs = {
'dom.fetchKeepalive.enabled': false,
};

View file

@ -41,6 +41,19 @@ it('should fire for fetches', async ({ page, server }) => {
expect(requests.length).toBe(2);
});
it('should fire for fetches with keepalive: true', {
annotation: {
type: 'issue',
description: 'https://github.com/microsoft/playwright/issues/34497'
}
}, async ({ page, server, browserName }) => {
const requests = [];
page.on('request', request => requests.push(request));
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => fetch('/empty.html', { keepalive: true }));
expect(requests.length).toBe(2);
});
it('should report requests and responses handled by service worker', async ({ page, server, isAndroid, isElectron }) => {
it.fixme(isAndroid);
it.fixme(isElectron);