From c9977c8004c1a1831609ce39f4e4a56271bc61ef Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 15 Jul 2019 17:52:40 -0700 Subject: [PATCH] fix(page): properly create isolated worlds (#4707) The following error: ``` Error: Protocol error (Page.createIsolatedWorld): No frame for given id found ``` was mentioned here: https://github.com/FlowCrypt/flowcrypt-browser/pull/1799#issuecomment-508729602 This indeed seems to be a bug with our creation of isolated worlds. --- lib/FrameManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/FrameManager.js b/lib/FrameManager.js index 818bf37b..4f0fa605 100644 --- a/lib/FrameManager.js +++ b/lib/FrameManager.js @@ -15,7 +15,7 @@ */ const EventEmitter = require('events'); -const {helper, assert} = require('./helper'); +const {helper, assert, debugError} = require('./helper'); const {Events} = require('./Events'); const {ExecutionContext, EVALUATION_SCRIPT_URL} = require('./ExecutionContext'); const {LifecycleWatcher} = require('./LifecycleWatcher'); @@ -276,7 +276,7 @@ class FrameManager extends EventEmitter { frameId: frame._id, grantUniveralAccess: true, worldName: name, - }))); + }).catch(debugError))); // frames might be removed before we send this } /**