From 1c7113418dc81cb081f9bf82cece6ec9c76b171e Mon Sep 17 00:00:00 2001 From: Timur Valiev Date: Sun, 12 Jul 2020 12:20:20 -0700 Subject: [PATCH] fix plugins array serialization Summary: new electron deprecated non-clonable serialization over ipc https://www.electronjs.org/docs/breaking-changes#behavior-changed-sending-non-js-objects-over-ipc-now-throws-an-exception Reviewed By: m1sk Differential Revision: D22455119 fbshipit-source-id: 075cc63e740d9f7986fc5a5ab7af605f8fc60bc8 --- desktop/static/SupportJSClientPreload.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/desktop/static/SupportJSClientPreload.js b/desktop/static/SupportJSClientPreload.js index da9dc0b43..32c33a9bd 100644 --- a/desktop/static/SupportJSClientPreload.js +++ b/desktop/static/SupportJSClientPreload.js @@ -23,12 +23,20 @@ ipcRenderer.on('parent-window-id', (event, message) => { flipperState.mainWindowId = message; }); +function cleanUpGWTArray(arr) { + const res = []; + for (let i = 0; i < arr.length; i++) { + res.push(arr[i]); + } + return res; +} + function initClient(plugins, appName) { if (flipperState.isClientInit) { return; } if (plugins) { - flipperState.plugins = plugins; + flipperState.plugins = cleanUpGWTArray(plugins); } if (appName) { flipperState.appName = appName;