Support Puppeteer's Page.close's runBeforeUnload argument
Categories
(Remote Protocol :: CDP, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: ochameau, Unassigned)
References
Details
Bug 1543071 introduce minimal support for puppeteer's Page.close
method,
but did not implemented the optional runBeforeUnload
argument.
This option depends on implementing CDP's Page.close
method:
https://github.com/GoogleChrome/puppeteer/blob/9ef23b17542cc630e502fcf6689bf6b20fa9911b/lib/Page.js#L985-L990
async close(options = {runBeforeUnload: undefined}) {
assert(!!this._client._connection, 'Protocol error: Connection closed. Most likely the page has been closed.');
const runBeforeUnload = !!options.runBeforeUnload;
if (runBeforeUnload) {
await this._client.send('Page.close');
} else {
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•2 years ago
|
Comment 1•2 years ago
|
||
runBeforeUnload
isn't an actual CDP argument and just a Puppeteer internal condition. Since we support Page.close
and Target.closeTarget
this should be done/marked as complete?
The related code in Puppeteer is here:
https://github.com/puppeteer/puppeteer/blob/9b54365df56914de0c4722233192f2095254da7c/packages/puppeteer-core/src/common/Page.ts#L1568-L1575
So yes, this should probably be done and it doesn't look like its actually awaiting for a Target.detachedFromTarget
event.
Description
•