Skip to content

Commit

Permalink
Enable DevTools on Stable (BetterDiscord#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyza authored Jan 26, 2022
1 parent a244863 commit 1d1fbc4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions injector/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 1d1fbc4

Please sign in to comment.