🐛 Inject the CSS the proper way
Signed-off-by: Luka Leer <luka.leer@gmail.com>
This commit is contained in:
parent
587bb8a1f4
commit
d736b6860a
|
@ -21,13 +21,6 @@ class BrowserWindow extends electron.BrowserWindow {
|
|||
if (typeof(shouldHaveFrame) === "boolean") options.frame = shouldHaveFrame;
|
||||
|
||||
super(options);
|
||||
|
||||
if (typeof(shouldHaveFrame) === "boolean" && shouldHaveFrame) {
|
||||
this.webContents.insertCSS(`div[class^="titleBar_"], div[class*=" titleBar_"] {
|
||||
display: none !important;
|
||||
}`);
|
||||
}
|
||||
|
||||
this.__originalPreload = originalPreload;
|
||||
BetterDiscord.setup(this);
|
||||
}
|
||||
|
|
|
@ -49,6 +49,13 @@ export default new class Core {
|
|||
Logger.log("Startup", "Initializing Settings");
|
||||
Settings.initialize();
|
||||
|
||||
Logger.log("Startup", "Injecting Setting-dependent BD Styles");
|
||||
if (Settings.get("settings", "window", "frame", false)) {
|
||||
DOMManager.injectStyle("bd-frame", `div[class^="titleBar_"], div[class*=" titleBar_"] {
|
||||
display: none !important;
|
||||
}`);
|
||||
}
|
||||
|
||||
Logger.log("Startup", "Initializing DOMManager");
|
||||
DOMManager.initialize();
|
||||
|
||||
|
|
Loading…
Reference in New Issue