From e7a3a61a73b7e0fc24c2b4a8682ff99ff5516790 Mon Sep 17 00:00:00 2001 From: Oj Date: Thu, 21 Apr 2022 21:22:48 +0100 Subject: [PATCH] [Bootstrap] Fix random JS injection issues because Electron --- src/bootstrap.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bootstrap.js b/src/bootstrap.js index c7b7756..a8e9305 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -49,12 +49,11 @@ const startCore = () => { const [ channel, hash ] = oaVersion.split('-'); // Split via - - const exec = bw.webContents.executeJavaScript; - exec(readFileSync(join(__dirname, 'mainWindow.js'), 'utf8') + bw.webContents.executeJavaScript(readFileSync(join(__dirname, 'mainWindow.js'), 'utf8') .replaceAll('', channel) .replaceAll('', hash || 'custom')); - if (oaConfig.js) exec(oaConfig.js); + if (oaConfig.js) bw.webContents.executeJavaScript(oaConfig.js); }); }); @@ -83,7 +82,7 @@ const startCore = () => { }); }; -const startUpdate = async () => { +const startUpdate = () => { if (oaConfig.noTrack !== false) { const bl = { cancel: true }; // Standard block callback response