puppeteer/experimental/puppeteer-firefox/lib
Yury Semikhatsky e0c8d46af1 fix: abort page.waitForRequest/Response when page closes (#4865)
We'd like to pass an abortion signal inside Helper.waitForEvent in order to interrupt it when browser/page closes. Several approaches have been considered:

1. Pass CDPSession instance as a another parameter to the helper method and listen to Disconnected event on it. It would introduce undesired dependency on the session object.
2. Listen to the CDPSession closure at the call sites (e.g. waitForRequest) and pass an abortion promise which would be fulfilled when such event is fired. The listeners would have to be removed from the session on successful completion of waitForEvent so we'd have to pass some kind of DisposablePromise which would be disposed during cleanup. Such parameter looked somewhat hairy.
3. Create DisconnectPromise on CDPSession. One potential risk with that is all chained promises would hang around until the event is fired which might inadvertently cause memory leaks. On the other hand, adding such promise to Promise.race will remove dependency as soon as the race is finished. So this is the approach we're taking with one tweak: the promise is created locally inside Page. 

Ideally the disconnectPromise would throw when the session is closed but it may lead to uncaught promise errors if all chained promises are resolved, to avoid that the promise is resolved with an Error and Helper.waitForEvent throws it later.

Fix #4733
2019-08-21 10:26:48 -07:00
..
Accessibility.js feat(firefox): page.accessibility.snapshot() (#4071) 2019-02-25 21:57:33 -08:00
api.js feat(firefox): page.accessibility.snapshot() (#4071) 2019-02-25 21:57:33 -08:00
Browser.js feat(browser): Add browser.isConnected() (#4403) 2019-05-09 16:24:52 -07:00
BrowserFetcher.js fix(firefox): fix executablePath() on OSX (#4105) 2019-03-04 14:19:28 -08:00
Connection.js refactor(firefox): migrate onto Juggler flatten protocol (#4033) 2019-02-19 13:20:39 -08:00
DeviceDescriptors.js feat(puppeteer): introduce puppeteer.errors and puppeteer.devices (#4312) 2019-04-19 15:33:06 -07:00
Dialog.js chore(firefox): move sources from //lib/firefox to //lib (#3920) 2019-02-05 18:56:04 -08:00
DOMWorld.js feat(chromium): roll Chromium to r662092 (#4462) 2019-05-22 21:21:45 +03:00
Errors.js feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
Events.js refactor(firefox): migrate onto Juggler flatten protocol (#4033) 2019-02-19 13:20:39 -08:00
ExecutionContext.js fix: proper parse Error message on Node 12 (#4698) 2019-07-12 17:19:02 -07:00
externs.d.ts chore(firefox): move sources from //lib/firefox to //lib (#3920) 2019-02-05 18:56:04 -08:00
FrameManager.js feat(firefox): implement Page.touchscreen (#4070) 2019-02-25 15:36:38 -08:00
helper.js fix: abort page.waitForRequest/Response when page closes (#4865) 2019-08-21 10:26:48 -07:00
Input.js fix(firefox): fix missing awaits in mouse.click (#4561) 2019-06-10 16:53:38 -07:00
JSHandle.js feat(firefox): implement Page.touchscreen (#4070) 2019-02-25 15:36:38 -08:00
Launcher.js feat(firefox): implement missing launcher options (#4036) 2019-02-19 22:08:09 -08:00
NavigationWatchdog.js feat(firefox): implement missing launcher options (#4036) 2019-02-19 22:08:09 -08:00
NetworkManager.js fix(network): be able to remove headers using request.continue (#4797) 2019-08-05 15:26:17 -07:00
Page.js fix: abort page.waitForRequest/Response when page closes (#4865) 2019-08-21 10:26:48 -07:00
Puppeteer.js feat(puppeteer): introduce puppeteer.errors and puppeteer.devices (#4312) 2019-04-19 15:33:06 -07:00
TimeoutSettings.js fix: abort page.waitForRequest/Response when page closes (#4865) 2019-08-21 10:26:48 -07:00
USKeyboardLayout.js chore(firefox): move sources from //lib/firefox to //lib (#3920) 2019-02-05 18:56:04 -08:00
WebSocketTransport.js feat(firefox): switch over to WebSocket and support multiclient (#4022) 2019-02-15 17:57:48 -08:00