Skip to content

Instantly share code, notes, and snippets.

@JohannesMP
Forked from ExordiumX/betaenabler.js
Last active April 2, 2025 12:17
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

@The-DarkMatter
Copy link

minified: d=null,webpackChunkdiscord_app.push([[Symbol()],{},({c:e})=>d=Object.values(e)]),c=d,delete d,u=c.find((e=>e?.exports?.default?.getUsers)).exports.default,m=Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes),u.getCurrentUser().flags|=1,m.find((e=>"DeveloperExperimentStore"===e.name)).actionHandler.CONNECTION_OPEN();try{m.find((e=>"ExperimentStore"===e.name)).actionHandler.OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find((e=>"ExperimentStore"===e.name)).storeDidChange();

This worked for me. Thanks
I was getting uncaught type error

@dreams
Copy link

dreams commented Jan 17, 2025

broken again lol

@Syhix
Copy link

Syhix commented Feb 9, 2025

minified: d=null,webpackChunkdiscord_app.push([[Symbol()],{},({c:e})=>d=Object.values(e)]),c=d,delete d,u=c.find((e=>e?.exports?.default?.getUsers)).exports.default,m=Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes),u.getCurrentUser().flags|=1,m.find((e=>"DeveloperExperimentStore"===e.name)).actionHandler.CONNECTION_OPEN();try{m.find((e=>"ExperimentStore"===e.name)).actionHandler.OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find((e=>"ExperimentStore"===e.name)).storeDidChange();

This worked for me. Thanks I was getting uncaught type error

worked for me 👍

@martincutcher
Copy link

(function(v) {

if (window.disabled)
	return;

if (v && v != []) {
	console.log(v);
	window.thediscordapp = v;
}

if (document.domain != "discord.com" || !window?.webpackChunkdiscord_app) {
	window.__defineGetter__("webpackChunkdiscord_app", function() {
		return window.thediscordapp;
	});
	window.__defineSetter__("webpackChunkdiscord_app", arguments.callee)
	return;
}
	

d=null;webpackChunkdiscord_app.push([[Symbol()],{},({c})=>d=Object.values(c)]);c=d;delete d;

if (!c)
	return;

try {
	
u = c.find((x)=> x?.exports?.default?.getUsers).exports.default;
m = Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes);

    let flags = {
        "DISCORD_EMPLOYEE": 1 << 0,
        "DISCORD_PARTNER": 1 << 1,
        "HYPESQUAD_EVENTS": 1 << 2,
        "BUG_HUNTER_LEVEL_1": 1 << 3,
        "HOUSE_BRAVERY": 1 << 6,
        "HOUSE_BRILLIANCE": 1 << 7,
        "HOUSE_BALANCE": 1 << 8,
        "EARLY_SUPPORTER": 1 << 9,
        "BUG_HUNTER_LEVEL_2": 1 << 14,
        "VERIFIED_BOT_DEVELOPER": 1 << 17,
        "CERTIFIED_MODERATOR": 1 << 18
    };


flag = Object.values(flags).reduce((pre, cur) => pre + cur, 0)
u.getCurrentUser().flags |= flag;
m.find((x)=>x.name === "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]();
try {m.find((x)=>x.name === "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user:{flags: flag}})} catch {}
m.find((x)=>x.name === "ExperimentStore").storeDidChange()

} catch {
	return;
}

window.disabled = true;
})();

Update: can now be executed on page load

minified: !function(e){if(!window.disabled){if(e&&e!=[]&&(console.log(e),window.thediscordapp=e),"discord.com"!=document.domain||!window?.webpackChunkdiscord_app)return window.__defineGetter__("webpackChunkdiscord_app",(function(){return window.thediscordapp})),void window.__defineSetter__("webpackChunkdiscord_app",arguments.callee);if(d=null,webpackChunkdiscord_app.push([[Symbol()],{},({c:e})=>d=Object.values(e)]),c=d,delete d,c){try{u=c.find((e=>e?.exports?.default?.getUsers)).exports.default,m=Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes);let e={DISCORD_EMPLOYEE:1,DISCORD_PARTNER:2,HYPESQUAD_EVENTS:4,BUG_HUNTER_LEVEL_1:8,HOUSE_BRAVERY:64,HOUSE_BRILLIANCE:128,HOUSE_BALANCE:256,EARLY_SUPPORTER:512,BUG_HUNTER_LEVEL_2:16384,VERIFIED_BOT_DEVELOPER:1<<17,CERTIFIED_MODERATOR:1<<18};flag=Object.values(e).reduce(((e,d)=>e+d),0),u.getCurrentUser().flags|=flag,m.find((e=>"DeveloperExperimentStore"===e.name)).actionHandler.CONNECTION_OPEN();try{m.find((e=>"ExperimentStore"===e.name)).actionHandler.OVERLAY_INITIALIZE({user:{flags:flag}})}catch{}m.find((e=>"ExperimentStore"===e.name)).storeDidChange()}catch{return}window.disabled=!0}}}();

How do you make it execute on page load? It keeps disappearing every time I close and open Discord, so if there's a way to keep it enabled or automatically enable it on startup, that would be extremely helpful!

@Ketaklak
Copy link

U'd need 2 edit Discord's client directly in the source code (tho this is against Discord's ToS and would reset every time Discord updates), or make a Python app that auto-injects ur JS code when launching Discord (script would start Discord + inject code at the same time). Otherwise, gotta be quick manually each time u open Discord!

@qwertychouskie
Copy link

d=null;webpackChunkdiscord_app.push([[Symbol()],{},({c})=>d=Object.values(c)]);c=d;delete d;
u = c.find((x)=> x?.exports?.default?.getUsers).exports.default;
m = Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes);

u.getCurrentUser().flags |= 1;
m.find((x)=>x.name === "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]();
try {m.find((x)=>x.name === "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user:{flags: 1}})} catch {}
m.find((x)=>x.name === "ExperimentStore").storeDidChange()

works for me fine

minified: d=null,webpackChunkdiscord_app.push([[Symbol()],{},({c:e})=>d=Object.values(e)]),c=d,delete d,u=c.find((e=>e?.exports?.default?.getUsers)).exports.default,m=Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes),u.getCurrentUser().flags|=1,m.find((e=>"DeveloperExperimentStore"===e.name)).actionHandler.CONNECTION_OPEN();try{m.find((e=>"ExperimentStore"===e.name)).actionHandler.OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find((e=>"ExperimentStore"===e.name)).storeDidChange();

This saved me from the terrible new UI "refresh". (Set "Desktop Visual Refresh" to "Not Eligible".) Thank you!

@Digibillcipher
Copy link

This saved me from the terrible new UI "refresh". (Set "Desktop Visual Refresh" to "Not Eligible".) Thank you!

Thank you (TTдTT)

@RetroRevo
Copy link

This saved me from the terrible new UI "refresh". (Set "Desktop Visual Refresh" to "Not Eligible".) Thank you!

thank you as well, saved me too!

@LastStardaughter
Copy link

LastStardaughter commented Mar 26, 2025

This keeps returning undefined and doesn't do anything. Help!
Edit: TheAlphaGhast's version worked. Hooray!

@sbalatbat
Copy link

This keeps returning undefined and doesn't do anything. Help! Edit: TheAlphaGhast's version worked. Hooray!

Which one were you using? I just got the UI update and wanted to revert back but this version of TheAlphaGhast's reply doesn't work

d=null;webpackChunkdiscord_app.push([[Symbol()],{},({c})=>d=Object.values(c)]);c=d;delete d;
u = c.find((x)=> x?.exports?.default?.getUsers).exports.default;
m = Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes);

u.getCurrentUser().flags |= 1;
m.find((x)=>x.name === "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]();
try {m.find((x)=>x.name === "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user:{flags: 1}})} catch {}
m.find((x)=>x.name === "ExperimentStore").storeDidChange()

works for me fine

minified: d=null,webpackChunkdiscord_app.push([[Symbol()],{},({c:e})=>d=Object.values(e)]),c=d,delete d,u=c.find((e=>e?.exports?.default?.getUsers)).exports.default,m=Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes),u.getCurrentUser().flags|=1,m.find((e=>"DeveloperExperimentStore"===e.name)).actionHandler.CONNECTION_OPEN();try{m.find((e=>"ExperimentStore"===e.name)).actionHandler.OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find((e=>"ExperimentStore"===e.name)).storeDidChange();

@SpoopyWinter
Copy link

Worked for me to get access to experiments + remove the ui enshitification

minified: d=null,webpackChunkdiscord_app.push([[Symbol()],{},({c:e})=>d=Object.values(e)]),c=d,delete d,u=c.find((e=>e?.exports?.default?.getUsers)).exports.default,m=Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes),u.getCurrentUser().flags|=1,m.find((e=>"DeveloperExperimentStore"===e.name)).actionHandler.CONNECTION_OPEN();try{m.find((e=>"ExperimentStore"===e.name)).actionHandler.OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find((e=>"ExperimentStore"===e.name)).storeDidChange();

@Stefan-Tadic
Copy link

Thank you so much for this holy fuck. The new visual refresh is disgusting.

@swinokur
Copy link

Yes, thanks for this!

Does someone have a version of this as a script for Tampermonkey for those of us who are just using a regular browser? Pasting into the console is fine, but it'd be nice to have it "just work".

@sbalatbat
Copy link

Is there a way to make it persistent so I don't have to do it every time I launch discord?

@Stefan-Tadic
Copy link

I tried setting "update.exe" to read only but it doesn't work. Whenever you relaunch discord you have to copy paste this back in. Spoopy Winter's comment works, will copy paste it here just in case he deletes his comment.

d=null,webpackChunkdiscord_app.push([[Symbol()],{},({c:e})=>d=Object.values(e)]),c=d,delete d,u=c.find((e=>e?.exports?.default?.getUsers)).exports.default,m=Object.values(u._dispatcher._actionHandlers._dependencyGraph.nodes),u.getCurrentUser().flags|=1,m.find((e=>"DeveloperExperimentStore"===e.name)).actionHandler.CONNECTION_OPEN();try{m.find((e=>"ExperimentStore"===e.name)).actionHandler.OVERLAY_INITIALIZE({user:{flags:1}})}catch{}m.find((e=>"ExperimentStore"===e.name)).storeDidChange();

@Dwyriel
Copy link

Dwyriel commented Mar 27, 2025

@sbalatbat currently the best way is to use Vencord, activate the plugin that enables the Experiements tab in the settings and changing whatever you want there. It'll remember everything you changed. (This is against ToS, do it at your own risk and blablabla, don't think anyone ever got banned though)

@VReaperV
Copy link

Putting the above code into a BetterDiscord plugin also works (although needed to fix a couple issues to make it run outside of the console, uploaded here if anyone needs it).

@VReaperV
Copy link

Also, the user list in servers is entirely fucked when using the experiment thing to unshittify UI.

@Dwyriel
Copy link

Dwyriel commented Mar 27, 2025

@VReaperV it looks exactly the same to me as it did before, though, as I said, I'm using Vencord to disable the Experiment.

@SpoopyWinter
Copy link

Also, the user list in servers is entirely fucked when using the experiment thing to unshittify UI.

Are you referring to the BetterDiscord user list when opting out of the visual refresh in experiments?

@Ketaklak
Copy link

Install Vencord, open plugins, activate « experiments »

@Dwyriel
Copy link

Dwyriel commented Mar 27, 2025

Hate spamming, but I poked around a bunch of different servers and I did encounter a problem with the user list in a few of them like @VReaperV said.

The problem comes from the channel's description that shows next to the channel name above the chat area, if it's too long it "pushes" the user list to the side and hides it or only show it partially.
If the channel description is not long enough (or there isn't one), then everything works as intended.

@VReaperV
Copy link

Nah, the list gets cut off like this:
image

Because the area with messages is not fixed-width.

@VReaperV
Copy link

Hate spamming, but I poked around a bunch of different servers and I did encounter a problem with the user list in a few of them like @VReaperV said.

The problem comes from the channel's description that shows next to the channel name above the chat area, if it's too long it "pushes" the user list to the side and hides it or only show it partially.

Oh, so it's the description, not the messages.

@SpoopyWinter
Copy link

Maybe an issue with one of your settings through your client? Unable to replicate on my end.

@VReaperV
Copy link

Maybe an issue with one of your settings through your client? Unable to replicate on my end.

It's possible I guess, though it'd have to be some new setting introduced with that update, as I haven't changed any in a while. Have you tried reproducing with the long channel descriptions?

Also, the profile icons/buttons for users connected to a voice call (at least for voice calls in DMs) have incorrect alignment - they stick to top left, rather than being centered like before (probably related to the fact that the other voice call buttons are styled the same as with new UI).

@Dwyriel
Copy link

Dwyriel commented Mar 27, 2025

@SpoopyWinter couldn't upload a video here directly so I put it on Youtube, I have tried messing around with setting and all but nothing fixed it (also completely removed the custom theme, but no difference either).

I can also confirm that the user icons are messed up in DM calls.

@SKDemon820
Copy link

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

.children__9293f {
    width:0px
}

@RetroRevo
Copy link

@SKDemon820 thank you so much for that

@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.

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