mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: handle frame manager init without unhandled rejection (#10902)
This commit is contained in:
parent
4b8d20d0ed
commit
ea14834fdf
@ -238,19 +238,16 @@ export class FrameManager extends EventEmitter<FrameManagerEvents> {
|
|||||||
|
|
||||||
async initialize(client: CDPSession): Promise<void> {
|
async initialize(client: CDPSession): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const networkInit = this.#networkManager.addClient(client);
|
|
||||||
const result = await Promise.all([
|
|
||||||
client.send('Page.enable'),
|
|
||||||
client.send('Page.getFrameTree'),
|
|
||||||
]);
|
|
||||||
const {frameTree} = result[1];
|
|
||||||
this.#handleFrameTree(client, frameTree);
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
this.#networkManager.addClient(client),
|
||||||
|
client.send('Page.enable'),
|
||||||
|
client.send('Page.getFrameTree').then(({frameTree}) => {
|
||||||
|
this.#handleFrameTree(client, frameTree);
|
||||||
|
}),
|
||||||
client.send('Page.setLifecycleEventsEnabled', {enabled: true}),
|
client.send('Page.setLifecycleEventsEnabled', {enabled: true}),
|
||||||
client.send('Runtime.enable').then(() => {
|
client.send('Runtime.enable').then(() => {
|
||||||
return this.#createIsolatedWorld(client, UTILITY_WORLD_NAME);
|
return this.#createIsolatedWorld(client, UTILITY_WORLD_NAME);
|
||||||
}),
|
}),
|
||||||
networkInit,
|
|
||||||
]);
|
]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// The target might have been closed before the initialization finished.
|
// The target might have been closed before the initialization finished.
|
||||||
|
@ -4088,7 +4088,7 @@
|
|||||||
{
|
{
|
||||||
"testIdPattern": "[coverage.spec] Coverage specs JSCoverage resetOnNavigation should report scripts across navigations when disabled",
|
"testIdPattern": "[coverage.spec] Coverage specs JSCoverage resetOnNavigation should report scripts across navigations when disabled",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
"parameters": ["chrome", "new-headless", "cdp", "tabTarget"],
|
"parameters": ["cdp", "chrome", "new-headless", "tabTarget"],
|
||||||
"expectations": ["FAIL"]
|
"expectations": ["FAIL"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user