From ed27067fc95a972a30920791dd3542ed4db39621 Mon Sep 17 00:00:00 2001 From: Astra Date: Thu, 3 May 2018 14:00:08 -0400 Subject: [PATCH] please work this time and dont break other things --- monitor.htm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/monitor.htm b/monitor.htm index 6f33af9..53e2d4f 100644 --- a/monitor.htm +++ b/monitor.htm @@ -40,17 +40,20 @@ win.webContents.executeJavaScript(stage2); }); + var preload = ''; + if (fs.existsSync(data + '/preload.js')) { + preload = fs.readFileSync(data + '/preload.js').toString(); + } + win.webContents.on('did-start-loading', () => { + win.webContents.executeJavaScript(preload); + }); + // get the data path var data = electron.app.getPath('userData'); function load() { var branch = require('path').basename(data).substr(7); - var preload = ''; - if (fs.existsSync(data + '/preload.js')) { - preload = fs.readFileSync(data + '/preload.js').toString(); - } win.loadURL('https://' + (branch ? branch + '.' : '') + 'discordapp.com/channels/@me'); - win.webContents.executeJavaScript(preload); } // dont update EPAPI if DONTUPDATE exists