Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Aholicknight/ea89d7c3995c002778a550c86ef8afba to your computer and use it in GitHub Desktop.
Save Aholicknight/ea89d7c3995c002778a550c86ef8afba to your computer and use it in GitHub Desktop.
Enabling Discord Dev Experiments on Discord for Windows (2022-02)

Enable Dev Experiments in Discord for Windows

image

This guide shows how to enable dev mode for the Discord desktop application running on Windows (as of February 2022).

This can be used to view beta experiments to try features currently in development that are included but hidden by default in Discord release builds.


Enable the Discord Dev Console

Under the hood the Discord application is just trimmed down web browser, with much of the UI logic being written in javascript. Like Google Chrome, it includes a Developer console for running javascript code.

image

This dev console can be used to modify settings in Discord that are normally hidden. This includes beta/testing settings and experiments that are included in public builds but hidden by default.

If your Discord opens its dev console when you press Ctrl+Shift+i you can skip to the next section below.


As of 2022/01/28 this console is disabled unless you enable it manually in Discord's settings file:

  1. Use WIN+R to open the Windows 'Run' dialog and paste in the appropriate path to open the corresponding settings directory of your discord installation:

    • Discord: %APPDATA%\Discord\
    • Discord PTB (Public Test Build): %APPDATA%\DiscordPTB\
    • Discord Canary: %APPDATA%\discordcanary\
  2. In this directory, open the settings.json file

image

  1. Add the following entry to the settings.json file:
"DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true

So for example, if your settings.json looks like this:

{
  "BACKGROUND_COLOR": "#202225",
  "IS_MAXIMIZED": false,
  "IS_MINIMIZED": false,
  "WINDOW_BOUNDS": {
    "x": 288,
    "y": 51,
    "width": 1591,
    "height": 919
  },
  "OPEN_ON_STARTUP": false
}

You should modify it to look like this:

{
  "BACKGROUND_COLOR": "#202225",
  "IS_MAXIMIZED": false,
  "IS_MINIMIZED": false,
  "WINDOW_BOUNDS": {
    "x": 288,
    "y": 51,
    "width": 1591,
    "height": 919
  },
  "OPEN_ON_STARTUP": false,
  "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true
}

NOTE: A comma is necessary after the "OPEN_ON_STARTUP": true/false line! MAKE SURE YOU ADD IT!!


  1. Save your settings.json file and completely shut down Discord

    • Ensure you don't just close the window, but also that Discord is no longer visible in your taskbar notification bar.
    • When in doubt, just force quit it using the task manager :P
  2. Restart Discord

  3. In Discord, open the Dev console using Ctrl+Shift+i


Using Discord Dev console to show dev options

WARNING: the Discord dev console can be used to access the internal settings of Discord, including your login credentials.

That is why the dev console explicitly outputs the following warnings: image

Treat any code you are asked to run in the dev console with strict scrutiny.


Since these instructions are having you do exactly that, you should first assure yourself that the code is actually safe to use.

Here is formatted version of the code you will be asked to run (note that line breaks and indenting does not change the code):

const c = window.webpackChunkdiscord_app.push([
  [Symbol()],
  {},
  ({ c }) => Object.values(c),
]);
userMod = c.find((x) => x?.exports?.default?.getUsers).exports.default
  .__proto__;
nodes = Object.values(
  c.find((x) => typeof x?.exports?.default?.isDeveloper !== "undefined").exports
    .default._dispatcher._actionHandlers._dependencyGraph.nodes
);
try {
  nodes
    .find((x) => x.name === "ExperimentStore")
    .actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } });
} catch {}
oldGCUser = userMod.getCurrentUser;
userMod.getCurrentUser = () => {
  return { hasFlag: () => true };
};
nodes
  .find((x) => x.name === "DeveloperExperimentStore")
  .actionHandler["OVERLAY_INITIALIZE"]();
userMod.getCurrentUser = oldGCUser;

This code ensures that interal nodes for user data trigger specifically for the Experiments menu and the Developer Experiments within that menu, allowing you both access to the Experiments menu and to use the Experiments within the menu.

Once you have assured yourself that this line is identical to the one shown above, copy the code completely and then paste it into the discord dev console and hit return:

image


You'll know that this worked if you when you open your Discord settings you see the following: image

NOTE: If your Discord settings were open when you ran the command close and open them again.


Enabling Discord Experiments

You can now view Discord experiments by selecting 'Experiments' at the bottom of the left sidebar in the Settings UI.

You can then search for specific settings, such as enabling the multi-account experiment:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment