From 3c20ab411f9d9015bd9e879212e24826bceb3295 Mon Sep 17 00:00:00 2001 From: DimaShustal Date: Wed, 15 Dec 2021 16:16:15 +0300 Subject: [PATCH 1/5] fix(page): Page.createIsolatedWorld error catching has been added when navigating, frames are destroyed and sending events leads to an error that crashes the whole process --- src/common/FrameManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/FrameManager.ts b/src/common/FrameManager.ts index 19f2a3b1d0ea5..6c8cdbe7a5bf9 100644 --- a/src/common/FrameManager.ts +++ b/src/common/FrameManager.ts @@ -398,7 +398,7 @@ export class FrameManager extends EventEmitter { frameId: frame._id, worldName: name, grantUniveralAccess: true, - }) + }).catch(console.error) ) ); } From 56d88d3c61f42b1626c8c676f0b5425e7eeb41b6 Mon Sep 17 00:00:00 2001 From: DimaShustal Date: Wed, 29 Dec 2021 21:49:57 +0300 Subject: [PATCH 2/5] fix(page): console.error was replaced by debugError --- src/common/FrameManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/FrameManager.ts b/src/common/FrameManager.ts index 6c8cdbe7a5bf9..9f435165b8aa1 100644 --- a/src/common/FrameManager.ts +++ b/src/common/FrameManager.ts @@ -16,7 +16,7 @@ import { EventEmitter } from './EventEmitter.js'; import { assert } from './assert.js'; -import { helper } from './helper.js'; +import { helper, debugError } from './helper.js'; import { ExecutionContext, EVALUATION_SCRIPT_URL } from './ExecutionContext.js'; import { LifecycleWatcher, @@ -398,7 +398,7 @@ export class FrameManager extends EventEmitter { frameId: frame._id, worldName: name, grantUniveralAccess: true, - }).catch(console.error) + }).catch(debugError) ) ); } From 0eebe4eb5f2f31df818ea8ea80c10927e00c7890 Mon Sep 17 00:00:00 2001 From: DimaShustal Date: Wed, 15 Dec 2021 16:16:15 +0300 Subject: [PATCH 3/5] fix(page): Page.createIsolatedWorld error catching has been added when navigating, frames are destroyed and sending events leads to an error that crashes the whole process --- src/common/FrameManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/FrameManager.ts b/src/common/FrameManager.ts index c2639a956d3be..5338b584be322 100644 --- a/src/common/FrameManager.ts +++ b/src/common/FrameManager.ts @@ -397,7 +397,7 @@ export class FrameManager extends EventEmitter { frameId: frame._id, worldName: name, grantUniveralAccess: true, - }) + }).catch(console.error) ) ); } From 32d4312483bf583216f5e3fbf3c2faef8ed972af Mon Sep 17 00:00:00 2001 From: DimaShustal Date: Wed, 29 Dec 2021 21:49:57 +0300 Subject: [PATCH 4/5] fix(page): console.error was replaced by debugError --- src/common/FrameManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/FrameManager.ts b/src/common/FrameManager.ts index 5338b584be322..dbcb659b14400 100644 --- a/src/common/FrameManager.ts +++ b/src/common/FrameManager.ts @@ -16,7 +16,7 @@ import { EventEmitter } from './EventEmitter.js'; import { assert } from './assert.js'; -import { helper } from './helper.js'; +import { helper, debugError } from './helper.js'; import { ExecutionContext, EVALUATION_SCRIPT_URL } from './ExecutionContext.js'; import { LifecycleWatcher, @@ -397,7 +397,7 @@ export class FrameManager extends EventEmitter { frameId: frame._id, worldName: name, grantUniveralAccess: true, - }).catch(console.error) + }).catch(debugError) ) ); } From 35b38fc58df60709ee5debe8a8ed1232183ffba4 Mon Sep 17 00:00:00 2001 From: DimaShustal Date: Fri, 25 Feb 2022 18:39:28 +0300 Subject: [PATCH 5/5] fix(page): eslint changes --- src/common/FrameManager.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/common/FrameManager.ts b/src/common/FrameManager.ts index dbcb659b14400..b10f0e63c23a3 100644 --- a/src/common/FrameManager.ts +++ b/src/common/FrameManager.ts @@ -393,11 +393,13 @@ export class FrameManager extends EventEmitter { this.frames() .filter((frame) => frame._client === session) .map((frame) => - session.send('Page.createIsolatedWorld', { - frameId: frame._id, - worldName: name, - grantUniveralAccess: true, - }).catch(debugError) + session + .send('Page.createIsolatedWorld', { + frameId: frame._id, + worldName: name, + grantUniveralAccess: true, + }) + .catch(debugError) ) ); }