[MainWindow] Clean up injection source

This commit is contained in:
Ducko 2022-03-10 21:27:02 +00:00
parent 0c8033616a
commit 4e21350ca3
2 changed files with 7 additions and 8 deletions

13
src/bootstrap.js vendored
View file

@ -62,14 +62,13 @@ const startCore = () => {
donePageReady = true;
}
let injectJs = readFileSync(join(__dirname, 'mainWindowInject.js'), 'utf8');
const [ channel, hash ] = oaVersion.split('-'); // Split via -
const [ version1, version2 ] = oaVersion.split('-'); // Split via -
injectJs = injectJs
.replaceAll('<oa_version_channel>', version1[0].toUpperCase() + version1.substring(1).toLowerCase())
.replaceAll('<oa_version_hash>', version2 || 'custom');
bw.webContents.executeJavaScript(injectJs);
bw.webContents.executeJavaScript(
readFileSync(join(__dirname, 'mainWindowInject.js'), 'utf8')
.replaceAll('<channel>', channel)
.replaceAll('<hash>', hash || 'custom')
);
});
});
};

View file

@ -26,7 +26,7 @@ setInterval(() => {
const css = `
[class^="socialLinks-"] + [class^="info-"] [class^="colorMuted-"]:nth-last-child(2)::after {
content: " | OpenAsar <oa_version_hash>";
content: " | OpenAsar <hash>";
display: inline;
text-transform: none;
}