Skip to content

Instantly share code, notes, and snippets.

@JohannesMP
Forked from ExordiumX/betaenabler.js
Last active April 22, 2025 06:23
Show Gist options
  • Save JohannesMP/afdf27383608c3b6f20a6a072d0be93c to your computer and use it in GitHub Desktop.
Save JohannesMP/afdf27383608c3b6f20a6a072d0be93c 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):

Object.defineProperty(
    (webpackChunkdiscord_app.push([
        [""],
        {},
        (e) => {
            m = [];
            for (let c in e.c) m.push(e.c[c]);
        },
    ]),
    m).find((m) => m?.exports?.default?.isDeveloper !== void 0).exports.default,
    "isDeveloper",
    { get: () => true }
);

This code ensures that all isDeveloper properties in Discord's intrnal objects are forced to return true. It does not communicate with any external server, or touch your credentials.

With that out of the way, here is the same code but with extra newlines and spaces removed:

Object.defineProperty((webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.isDeveloper!==void 0).exports.default,"isDeveloper",{get:()=>true});

Once you have assured yourself that this line is identical to the one shown above, copy the single line 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

@Exterium
Copy link

Exterium commented Apr 2, 2025

@VReaperV @Dwyriel add this snippet to the custom CSS editor in BD settings

.children__9293f {
    width:0px
}

Screen share suffers the same issue, it extends past the border of the window when set to occupy the whole chat space (not fullscreen), but I haven't found a fix for this.

@SKDemon820
Copy link

Screen share suffers the same issue, it extends past the border of the window when set to occupy the whole chat space (not fullscreen), but I haven't found a fix for this.

@Exterium I don't really use that so I'm not sure of a better fix but this snippet can resize it, just manually change the XX% to whatever works in your window

.videoSizer_a21736 {
    width: 79%
}

@az4521
Copy link

az4521 commented Apr 3, 2025

Nah, the list gets cut off like this: image

Because the area with messages is not fixed-width.

/* fix overflow with long channel descriptions */
nav[class*="guilds"]+div[class*="base"] div[class*="sidebar"]+div {
    width: calc(100% - 240px)!important;
}

https://pastebin.com/Zu4XwGxx btw

@dakillerclown87
Copy link

is there a way to enable the name plates thing? i see it but i cant test them or anything. (meaning dont see them in the shop)

@tcgm
Copy link

tcgm commented Apr 11, 2025

Wrote a Tampermonkey script to run the working code and inject the CSS fixes.

// ==UserScript==
// @name         Discord Enable Experiments Web
// @namespace    https://discord.com/channels/
// @version      2025-04-11
// @description  try to take over the world!
// @author       TCGM
// @match        https://discord.com/channels/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=discord.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function wait(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    const enableExperiments = async () => {
        let cache; webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=r.c]);
        var UserStore = Object.values(cache).find(m => m?.exports?.default?.getUser).exports.default;
        var actions = Object.values(UserStore._dispatcher._actionHandlers._dependencyGraph.nodes);
        var user = UserStore.getCurrentUser();
        actions.find(n => n.name === "ExperimentStore").actionHandler.CONNECTION_OPEN({
            type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
        });
        actions.find(n => n.name === "DeveloperExperimentStore").actionHandler.CONNECTION_OPEN();
        webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";
    }
    
    const fixCSS = async () => {
        const style = document.createElement('style');
        style.textContent = `
            .children__9293f {
                width: 0px !important;
            }

            .videoSizer_a21736 {
                width: 79% !important;
            }

            /* fix overflow with long channel descriptions */
            nav[class*="guilds"]+div[class*="base"] div[class*="sidebar"]+div {
                width: calc(100% - 240px) !important;
            }
        `;
        document.head.appendChild(style);
    }

    wait(5000).then(() => {
        console.log("[Discord Enable Experiments Web] Enabling experiments...");
        enableExperiments();
        console.log("[Discord Enable Experiments Web] Fixing CSS...");
        fixCSS();
    });
})();

@PmikeGamer
Copy link

I can no longer remove the new UI.
It says
"Warning: Server did not send any experiment config. You may need to check the "Send to Client" box in the admin UI"
I have no idea what the admin UI is.

@Dwyriel
Copy link

Dwyriel commented Apr 15, 2025

yeah, they made it the "baseline/default" now, can't revert it using Experiments anymore and probably no way to revert it without applying a completely custom theme.

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