#Help with insertCSS
28 messages · Page 1 of 1 (latest)
i tried to print the css before inserting it, and it is actually valid css with no errors
With current code I don't think so
Show output from terminal
Have you remove console.log from readFile?
no
Remove it
okay
ohh now its printing "undefined"
so yea i think i messed up somewhere
strange
fs.readFile('./themes/dark.css', 'utf8', (err, data) => {
if (err) {
//console.error(err);
alert(err)
return;
}
console.log(data)
win.webContents.insertCSS(data, 'utf-8');
});```
Okay so i did that, now the inserted css is the css i want, but now, simply no change, just like i didnt inject the css
even if i remove that it still doesnt affect anything
Do you have inserted css in dom?
win.once('DOMContentLoaded', () => {
win.webContents.insertCSS(data);
})
like this ?
yea tried that too
didnt work
In devtools