var BdApi = { get React() { return BDV2.react; }, get ReactDOM() { return BDV2.reactDom; }, get WindowConfigFile() { if (this._windowConfigFile) return this._windowConfigFile; const base = require("electron").remote.app.getAppPath(); const path = require("path"); const location = path.resolve(base, "..", "app", "config.json"); const fs = require("fs"); if (!fs.existsSync(path.resolve(base, "..", "app"))) return this._windowConfigFile = null; if (!fs.existsSync(location)) fs.writeFileSync(location, JSON.stringify({})); return this._windowConfigFile = location; } }; BdApi.getAllWindowPreferences = function() { if ((bdConfig.os !== "win32" && bdConfig.os !== "darwin") || !this.WindowConfigFile) return {}; // Tempfix until new injection on other platforms return require(this.WindowConfigFile); }; BdApi.getWindowPreference = function(key) { if ((bdConfig.os !== "win32" && bdConfig.os !== "darwin") || !this.WindowConfigFile) return undefined; // Tempfix until new injection on other platforms return this.getAllWindowPreferences()[key]; }; BdApi.setWindowPreference = function(key, value) { if ((bdConfig.os !== "win32" && bdConfig.os !== "darwin") || !this.WindowConfigFile) return; // Tempfix until new injection on other platforms const fs = require("fs"); const prefs = this.getAllWindowPreferences(); prefs[key] = value; delete require.cache[this.WindowConfigFile]; fs.writeFileSync(this.WindowConfigFile, JSON.stringify(prefs, null, 4)); }; //Inject CSS to document head //id = id of element //css = custom css BdApi.injectCSS = function (id, css) { $("head").append($("