css: rewrite css injection to use mainWindow to fix imports

This commit is contained in:
Ducko 2022-09-28 17:33:31 +01:00
parent a021777ede
commit 5d2bd94945
2 changed files with 4 additions and 3 deletions

4
src/bootstrap.js vendored
View File

@ -42,10 +42,10 @@ const startCore = () => {
bw.webContents.executeJavaScript(readFileSync(join(__dirname, 'mainWindow.js'), 'utf8')
.replaceAll('<hash>', hash || 'custom')
.replaceAll('<notrack>', oaConfig.noTrack));
.replaceAll('<notrack>', oaConfig.noTrack)
.replace('<css>', oaConfig.css.replaceAll('`', '\\`').replaceAll('\\', '\\\\')));
if (oaConfig.js) bw.webContents.executeJavaScript(oaConfig.js);
if (oaConfig.css) bw.webContents.insertCSS(oaConfig.css);
});
});

View File

@ -42,7 +42,8 @@ setInterval(() => {
const el = document.createElement('style');
el.appendChild(document.createTextNode(`[class^="socialLinks-"] + [class^="info-"] {
el.appendChild(document.createTextNode(`<css>
[class^="socialLinks-"] + [class^="info-"] {
padding-right: 0;
}