diff --git a/packages/playwright-core/browsers.json b/packages/playwright-core/browsers.json index 15054d0569..d105efada6 100644 --- a/packages/playwright-core/browsers.json +++ b/packages/playwright-core/browsers.json @@ -21,15 +21,15 @@ }, { "name": "firefox", - "revision": "1347", + "revision": "1350", "installByDefault": true, "browserVersion": "104.0" }, { "name": "firefox-beta", - "revision": "1348", + "revision": "1353", "installByDefault": false, - "browserVersion": "104.0b5" + "browserVersion": "105.0b2" }, { "name": "webkit", diff --git a/packages/playwright-core/src/server/firefox/ffBrowser.ts b/packages/playwright-core/src/server/firefox/ffBrowser.ts index a69fdead32..ff91a0ca21 100644 --- a/packages/playwright-core/src/server/firefox/ffBrowser.ts +++ b/packages/playwright-core/src/server/firefox/ffBrowser.ts @@ -122,6 +122,10 @@ export class FFBrowser extends Browser { assert(ffPage); if (!ffPage) return; + + // Abort the navigation that turned into download. + ffPage._page._frameManager.frameAbortedNavigation(payload.frameId, 'Download is starting'); + let originPage = ffPage._initializedPage; // If it's a new window download, report it on the opener page. if (!originPage) { diff --git a/packages/playwright-core/src/server/firefox/protocol.d.ts b/packages/playwright-core/src/server/firefox/protocol.d.ts index cf55fe64ee..2919b765d2 100644 --- a/packages/playwright-core/src/server/firefox/protocol.d.ts +++ b/packages/playwright-core/src/server/firefox/protocol.d.ts @@ -57,6 +57,7 @@ export module Protocol { uuid: string; browserContextId?: string; pageTargetId: string; + frameId: string; url: string; suggestedFileName: string; } @@ -569,7 +570,7 @@ export module Protocol { export type reloadReturnValue = void; export type adoptNodeParameters = { frameId: string; - objectId: string; + objectId?: string; executionContextId: string; }; export type adoptNodeReturnValue = { diff --git a/tests/library/download.spec.ts b/tests/library/download.spec.ts index 216960187a..4df67752dc 100644 --- a/tests/library/download.spec.ts +++ b/tests/library/download.spec.ts @@ -70,8 +70,8 @@ it.describe('download event', () => { expect(responseOrError.message).toContain('Download is starting'); expect(page.url()).toBe('about:blank'); } else { - expect(responseOrError.status()).toBe(200); - expect(page.url()).toBe(server.PREFIX + '/download'); + expect(responseOrError instanceof Error).toBeTruthy(); + expect(responseOrError.message).toContain('Download is starting'); } await page.close(); }); @@ -96,8 +96,8 @@ it.describe('download event', () => { expect(responseOrError.message).toContain('Download is starting'); expect(page.url()).toBe('about:blank'); } else { - expect(responseOrError.status()).toBe(200); - expect(page.url()).toBe(server.PREFIX + '/downloadWithCOOP'); + expect(responseOrError instanceof Error).toBeTruthy(); + expect(responseOrError.message).toContain('Download is starting'); } await page.close(); }); diff --git a/tests/page/page-goto.spec.ts b/tests/page/page-goto.spec.ts index e31d8bc82b..b94559a22d 100644 --- a/tests/page/page-goto.spec.ts +++ b/tests/page/page-goto.spec.ts @@ -630,19 +630,21 @@ it('should properly wait for load', async ({ page, server, browserName }) => { }); it('should not resolve goto upon window.stop()', async ({ browserName, page, server }) => { + it.fixme(browserName === 'firefox', 'load/domcontentloaded events are flaky'); + let response; server.setRoute('/module.js', (req, res) => { res.writeHead(200, { 'Content-Type': 'text/javascript' }); response = res; }); let done = false; - page.goto(server.PREFIX + '/window-stop.html').then(() => done = true).catch(() => {}); + const promise = page.goto(server.PREFIX + '/window-stop.html').then(() => done = true).catch(() => {}); await server.waitForRequest('/module.js'); expect(done).toBe(false); await page.waitForTimeout(1000); // give it some time to erroneously resolve response.end(''); await page.waitForTimeout(1000); // give it more time to erroneously resolve - expect(done).toBe(browserName === 'firefox'); // Firefox fires DOMContentLoaded and load events in this case. + expect(done).toBe(false); }); it('should return from goto if new navigation is started', async ({ page, server, browserName, isAndroid }) => {