From d174fd279f99444ea8ad5f30881159828bd2a7e8 Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Sun, 18 Dec 2022 13:18:42 +0000 Subject: [PATCH] ipc: fix incorrect function name --- src/lib/ipc.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/lib/ipc.js b/src/lib/ipc.js index 8447676..c6d0f5f 100644 --- a/src/lib/ipc.js +++ b/src/lib/ipc.js @@ -125,19 +125,21 @@ delete window._gluonSend; sendToWindow('pong', null, id); // send simple pong to confirm }; - return [ onWindowMessage, () => evaluate({ - expression: injection - }), { - on: (type, cb) => { - if (!ipcListeners[type]) ipcListeners[type] = []; - ipcListeners[type].push(cb); - }, + return [ + onWindowMessage, + () => evalInWindow(injection), - removeListener: (type, cb) => { - if (!ipcListeners[type]) return false; - ipcListeners[type].splice(ipcListeners[type].indexOf(cb), 1); - }, + { + on: (type, cb) => { + if (!ipcListeners[type]) ipcListeners[type] = []; + ipcListeners[type].push(cb); + }, - send: sendToWindow, + removeListener: (type, cb) => { + if (!ipcListeners[type]) return false; + ipcListeners[type].splice(ipcListeners[type].indexOf(cb), 1); + }, + + send: sendToWindow, } ]; }; \ No newline at end of file