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> {
|
||||
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([
|
||||
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('Runtime.enable').then(() => {
|
||||
return this.#createIsolatedWorld(client, UTILITY_WORLD_NAME);
|
||||
}),
|
||||
networkInit,
|
||||
]);
|
||||
} catch (error) {
|
||||
// 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",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["chrome", "new-headless", "cdp", "tabTarget"],
|
||||
"parameters": ["cdp", "chrome", "new-headless", "tabTarget"],
|
||||
"expectations": ["FAIL"]
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user