Enable DevTools on Stable (#1179)

This commit is contained in:
Kyza 2022-01-26 11:51:17 -05:00 committed by GitHub
parent a244863157
commit 1d1fbc4810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -22,6 +22,19 @@ if (!process.argv.includes("--vanilla")) {
else CSP.remove();
}
// Enable DevTools on Stable.
let fakeAppSettings;
Object.defineProperty(global, "appSettings", {
get() {
return fakeAppSettings;
},
set(value) {
if (!value.hasOwnProperty("settings")) value.settings = {};
value.settings.DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING = true;
fakeAppSettings = value;
},
});
// Use Discord's info to run the app
if (process.platform == "win32" || process.platform == "darwin") {
const basePath = path.join(app.getAppPath(), "..", "app.asar");