Skip to content

Instantly share code, notes, and snippets.

@JohannesMP
Forked from ExordiumX/betaenabler.js
Last active May 20, 2024 22:21
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

@veintrip
Copy link

let _,a=Object.values,b="getCurrentUser",c="actionHandler",d="_actionHandlers",l="_dispatcher",i="ExperimentStore";webpackChunkdiscord_app.push([[Date.now()],{},e=>{_=e}]),m=a((u=a(_.c).find(e=>e?.exports?.default?.[b]&&e?.exports?.default?.[l]?.[d]).exports.default)[l][d]._dependencyGraph.nodes),u[b]().flags|=1,m.find(e=>"Developer"+i==e.name)[c].CONNECTION_OPEN();try{m.find(e=>i==e.name)[c].OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find(e=>i==e.name).storeDidChange()

This is working, golfed MedLock's solution 611 -> 477 characters prettified below

let _, a = Object.values,
    b = "getCurrentUser",
    c = "actionHandler",
    d = "_actionHandlers",
    l = "_dispatcher",
    i = "ExperimentStore";
webpackChunkdiscord_app.push([
    [Date.now()], {},
    e => {
        _ = e
    }
]), m = a((u = a(_.c).find(e => e?.exports?.default?.[b] && e?.exports?.default?.[l]?.[d]).exports.default)[l][d]._dependencyGraph.nodes), u[b]().flags |= 1, m.find(e => "Developer" + i == e.name)[c].CONNECTION_OPEN();
try {
    m.find(e => i == e.name)[c].OVERLAY_INITIALIZE({
        user: {
            flags: 1
        }
    })
} catch {}
m.find(e => i == e.name).storeDidChange()

worked for me!

@Vann-Dev
Copy link

Vann-Dev commented Mar 4, 2024

let _,a=Object.values,b="getCurrentUser",c="actionHandler",d="_actionHandlers",l="_dispatcher",i="ExperimentStore";webpackChunkdiscord_app.push([[Date.now()],{},e=>{_=e}]),m=a((u=a(_.c).find(e=>e?.exports?.default?.[b]&&e?.exports?.default?.[l]?.[d]).exports.default)[l][d]._dependencyGraph.nodes),u[b]().flags|=1,m.find(e=>"Developer"+i==e.name)[c].CONNECTION_OPEN();try{m.find(e=>i==e.name)[c].OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find(e=>i==e.name).storeDidChange()

This is working, golfed MedLock's solution 611 -> 477 characters prettified below

let _, a = Object.values,
    b = "getCurrentUser",
    c = "actionHandler",
    d = "_actionHandlers",
    l = "_dispatcher",
    i = "ExperimentStore";
webpackChunkdiscord_app.push([
    [Date.now()], {},
    e => {
        _ = e
    }
]), m = a((u = a(_.c).find(e => e?.exports?.default?.[b] && e?.exports?.default?.[l]?.[d]).exports.default)[l][d]._dependencyGraph.nodes), u[b]().flags |= 1, m.find(e => "Developer" + i == e.name)[c].CONNECTION_OPEN();
try {
    m.find(e => i == e.name)[c].OVERLAY_INITIALIZE({
        user: {
            flags: 1
        }
    })
} catch {}
m.find(e => i == e.name).storeDidChange()

worked for me!

Still worked for me as today

@GamerBossHarmon
Copy link

let _,a=Object.values,b="getCurrentUser",c="actionHandler",d="_actionHandlers",l="_dispatcher",i="ExperimentStore";webpackChunkdiscord_app.push([[Date.now()],{},e=>{_=e}]),m=a((u=a(_.c).find(e=>e?.exports?.default?.[b]&&e?.exports?.default?.[l]?.[d]).exports.default)[l][d]._dependencyGraph.nodes),u[b]().flags|=1,m.find(e=>"Developer"+i==e.name)[c].CONNECTION_OPEN();try{m.find(e=>i==e.name)[c].OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find(e=>i==e.name).storeDidChange()

This is working, golfed MedLock's solution 611 -> 477 characters prettified below

let _, a = Object.values,
    b = "getCurrentUser",
    c = "actionHandler",
    d = "_actionHandlers",
    l = "_dispatcher",
    i = "ExperimentStore";
webpackChunkdiscord_app.push([
    [Date.now()], {},
    e => {
        _ = e
    }
]), m = a((u = a(_.c).find(e => e?.exports?.default?.[b] && e?.exports?.default?.[l]?.[d]).exports.default)[l][d]._dependencyGraph.nodes), u[b]().flags |= 1, m.find(e => "Developer" + i == e.name)[c].CONNECTION_OPEN();
try {
    m.find(e => i == e.name)[c].OVERLAY_INITIALIZE({
        user: {
            flags: 1
        }
    })
} catch {}
m.find(e => i == e.name).storeDidChange()

worked for me!

Still worked for me as today

Still worked for me

@Maple38
Copy link

Maple38 commented Apr 20, 2024

Any way to automate this?

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