armcord/utils/ArmCord.js

25 lines
835 B
JavaScript
Raw Normal View History

2021-05-09 19:48:24 +00:00
exports.Version = require("../package.json").version;
2021-07-15 13:45:56 +00:00
const fs = require("fs");
const electron = require("electron");
const userDataPath = (electron.app || electron.remote.app).getPath("userData");
const settingsFile= userDataPath + "/settings.json";
if (!fs.existsSync(settingsFile)) {
fs.writeFile(settingsFile, "{}", (err) => {
if (err) throw err;
});
console.log("Created settings.json file");
}
exports.Channel = require(settingsFile).channel;
2021-07-17 15:33:21 +00:00
exports.Titlebar = require(settingsFile).titlebar;
2021-05-09 16:57:48 +00:00
exports.addStyle = function(styleString) {
const style = document.createElement('style');
style.textContent = styleString;
document.head.append(style);
};
2021-05-09 19:38:06 +00:00
exports.addScript = function (scriptString) {
var script = document.createElement("script");
2021-05-09 16:57:48 +00:00
script.textContent = scriptString;
document.body.append(script);
2021-05-09 19:38:06 +00:00
};