[Bootstrap] Fix random JS injection issues because Electron

This commit is contained in:
Ducko 2022-04-21 21:22:48 +01:00
parent c3d6eced6c
commit e7a3a61a73
1 changed files with 3 additions and 4 deletions

7
src/bootstrap.js vendored
View File

@ -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>', channel)
.replaceAll('<hash>', 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