Skip to content

Instantly share code, notes, and snippets.

@MPThLee
Last active April 25, 2024 05:50
Show Gist options
  • Save MPThLee/3ccb554b9d882abc6313330e38e5dfaa to your computer and use it in GitHub Desktop.
Save MPThLee/3ccb554b9d882abc6313330e38e5dfaa to your computer and use it in GitHub Desktop.
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
* Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#comments
**/
// Older gist description: Enable Discord Developer Menus in any environment except mobile app without BetterDiscord using Console.
@jithatsonei
Copy link

jithatsonei commented Aug 11, 2022

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.default?.isDeveloper !== "undefined")
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.default._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["CONNECTION_OPEN"]({user: {flags: 1}, type: "CONNECTION_OPEN"})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

current working

@kyoyacchi
Copy link

Yeah it's working but is there a way to run that code when i go to "discord.com/app", im doing on mobile so it's a bit troublesome

@ExampleWasTaken
Copy link

Unless you have a console on mobile, there is no way to do that.

@kyoyacchi
Copy link

Unless you have a console on mobile, there is no way to do that.

I'm using Kiwi Browser, so there is a way?

@uSkizzik
Copy link

Unless you have a console on mobile, there is no way to do that.

I'm using Kiwi Browser, so there is a way?

If you're somehow running the web version of Discord, you can use that regardless of your device since Discord web is essentially the same as the desktop app.

@slorixsh
Copy link

still working on Discord Development Version.

@Git-North
Copy link

Git-North commented Aug 25, 2022

Does not work for me
Canary 143693 (93c74aa)

@slorixsh
Copy link

working on Canary 143708 (dfb9bfc)

@Mach1neCoder
Copy link

Works on regular discord now. Anyone have an updated betterdiscord plugin with the new code that works?

@TEnLOcODE
Copy link

@TymonKinneas
Copy link

Looks like discord broke it again.

@memetrollsXD
Copy link

yep..
image

@Meowxhehe
Copy link

Discord decided to be funny again and most likely renamed their internals
isDeveloper doesn't exist anymore so rip

@acendvgnt
Copy link

acendvgnt commented Sep 27, 2022

don't know what Discord was smoking but this should work

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

@jithatsonei
Copy link

.Z lmao

thx @acendvgnt

@Dnotcashier
Copy link

finally something works after 50 mins f searching for this. now i can party when it isnt discord's bday

@XxUnkn0wnxX
Copy link

XxUnkn0wnxX commented Oct 12, 2022

BD Plugin By Tharki-God | DiscordBypass (has it built in)
Although he has archived the repo, so this will be the last working BD plugin, why doesnt anyone share the plugin ver of these?
these are very hard to find or devs that actually publicly maintain these..

@SDCore
Copy link

SDCore commented Oct 13, 2022

This is incredibly helpful, why don't they just enable this for the prod version??

Because it's not meant to be used by normal users. It's meant for staff to debug the client and enable experiments to test features.

@fronc
Copy link

fronc commented Oct 13, 2022

Deleted my comment, I confused this page for the one that brought me here, and I was specifically thinking about the Stream HDR experiment, which is working very well for me now.

@pjotrekdev
Copy link

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

@volodyafrolov
Copy link

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

THX

@Stiefanek
Copy link

i get the error Uncaught TypeError: Cannot read property 'getCurrentUser' of undefined
at :9:44

@PoseidonFury
Copy link

this still works yay 👍

@momochqn
Copy link

momochqn commented Dec 7, 2022

don't know what Discord was smoking but this should work

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

Thanks this is working <3

@Gnoll94
Copy link

Gnoll94 commented Dec 15, 2022

don't know what Discord was smoking but this should work

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

This doesn't seem to work anymore on the PTB client. Getting the following message after pasting.

34c93d6e4bddfd759d05.js:5241 Uncaught TypeError: e.isStaff is not a function
at Object.p (34c93d6e4bddfd759d05.js:5241:620)
at :11:87
p @ 34c93d6e4bddfd759d05.js:5241
(anonymous) @ VM3272:11

c9e12c83553f81f1185c.js:149 TypeError: Cannot read properties of undefined (reading 'getTime')
at s (34c93d6e4bddfd759d05.js:6492:699)
at u (34c93d6e4bddfd759d05.js:6492:766)
at 974eb21932560550f3f3.js:1308:7
at f (34c93d6e4bddfd759d05.js:6895:190)
at 974eb21932560550f3f3.js:1307:851
at ya (34c93d6e4bddfd759d05.js:1567:54)
at bs (34c93d6e4bddfd759d05.js:1578:871)
at gu (34c93d6e4bddfd759d05.js:1622:18)
at mc (34c93d6e4bddfd759d05.js:1614:89)
at Ic (34c93d6e4bddfd759d05.js:1614:17)
at hc (34c93d6e4bddfd759d05.js:1613:867)
at ic (34c93d6e4bddfd759d05.js:1610:642)
at uc (34c93d6e4bddfd759d05.js:1611:49)
at jo (34c93d6e4bddfd759d05.js:1550:577)
at lc (34c93d6e4bddfd759d05.js:1611:498)
at t.flushSync (34c93d6e4bddfd759d05.js:1633:496)
at e.t.flushWaitQueue (34c93d6e4bddfd759d05.js:6889:257)
at e.t.wait (34c93d6e4bddfd759d05.js:6891:779)
at n. (34c93d6e4bddfd759d05.js:5577:145)
at n.i.emit (34c93d6e4bddfd759d05.js:569:354)
at n.r._handlePing (34c93d6e4bddfd759d05.js:3763:754)
at i.emit (34c93d6e4bddfd759d05.js:569:354)
at n.t.emit (34c93d6e4bddfd759d05.js:6862:111)
at Function.i.handlePing (34c93d6e4bddfd759d05.js:6972:319)

The line having issues is this one
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;

@TymonKinneas
Copy link

The code outright crashes discord now.

@acendvgnt
Copy link

acendvgnt commented Dec 16, 2022

The line having issues is this one oldGetUser = usermod.exports.default.__proto__.getCurrentUser;

The code outright crashes discord now.

this should work (simply changed hasFlag to isStaff)

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({isStaff: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

@Aholicknight
Copy link

this should work (simply changed hasFlag to isStaff)

@acendvgnt yup you are right, simply changing hasFlag to isStaff makes the plugin work again. Thank you!

@Pierre2004
Copy link

Pierre2004 commented Jan 7, 2023

Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(

@Aholicknight
Copy link

Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(

@PierreLGBT maybe if you ask in English

@catb0x
Copy link

catb0x commented Jan 18, 2023

Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(

@PierreLGBT maybe if you ask in English

i dont speak french but i speak spanish i think they want code to make this a bd plugin

@Fedox-die-Ente
Copy link

can anyone make that into a betterdc plugin

@Aholicknight
Copy link

Excusez moi vous avez le code pour créer un plugin ? Merci
Sur Betterdiscord il apparaît pas :(

@PierreLGBT maybe if you ask in English

i dont speak french but i speak spanish i think they want code to make this a bd plugin

@catb0x yes you are correct :)

@TymonKinneas
Copy link

discord is messing around with user state modifications (impersonation). this should work for build 168435 and up

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getNonImpersonatedCurrentUser;
usermod.exports.default.__proto__.getNonImpersonatedCurrentUser= () => ({isStaff: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getNonImpersonatedCurrentUser= oldGetUser

It seems like it stopped working as of the newest update.

@acendvgnt
Copy link

It seems like it stopped working as of the newest update.

yea i just deleted it XD

@diyar2137237243
Copy link

diyar2137237243 commented Jan 21, 2023

YOO NO IT STILL WORKS FOR ME LOL IT SEEMS TO BE UNPATCHED SO YALL SHOULD STILL USE IT!!!

window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({isStaff: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

@acendvgnt
Copy link

this should work in all cases

webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default; }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

@diyar2137237243
Copy link

oh btw the script I sent is old and it worked for me because I wasn't on the latest, acendvgnt posted a new one but I don't want to risk losing discord experiments to test it so yeah gl guys

@Kat2090
Copy link

Kat2090 commented Jan 24, 2023

Works.

@FirstViktor
Copy link

is there a way to make it so you dont have to run it each time you start discord

@acendvgnt
Copy link

is there a way to make it so you dont have to run it each time you start discord

not really but you can automate the process on the web version of Discord by using Tampermonkey or some other userscript extension

@Maple38
Copy link

Maple38 commented Feb 13, 2023

Here is a BetterDiscord plugin for it:

/**
 * @name Experiments
 * @author Maple38
 * @description Enables access to experiments and staff-only options for normal users.
 * @version 1.0.0
 */

let wpRequire

module.exports = class Experiments {
    load() {}

    start = () => {
        
        window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
        let mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
        let usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
        let nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
        try {
            nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
        } catch (e) {}
        let oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
        usermod.exports.default.__proto__.getCurrentUser = () => ({isStaff: () => true})
        nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
        usermod.exports.default.__proto__.getCurrentUser = oldGetUser
    }

    stop = () => {}
}

Put that into a BetterDiscord plugin and it should work. I simply turned the already working code to do it into a plugin that runs when you run Discord. I do not know any Javascript, so I probably won't be able to fix any issues you may have with it. Despite not knowing any Javascript, I somehow got this to work with the power of imagination and spending an hour assaulting my keyboard to fix errors.

If you don't know how to turn it into a plugin, just download this and put it in your plugins folder, which you can find by pressing Windows + R and typing %APPDATA%\BetterDiscord\plugins.

@senttohxll
Copy link

this should work in all cases

webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default; }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

works, thanks.

@CreepsoOff
Copy link

this should work in all cases

webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default; }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

I can confirm this works on stable at the date of 14/02/2023

@FirstViktor
Copy link

is it dangerous to use experiments on my main?

@tenent007963
Copy link

is it dangerous to use experiments on my main?

If you have any doubts, then you better don't do any of it, since its clearly against the T&C of Discord if you do so. There are people claiming Discord "knows everything" but it's likely only Discord's internal staff will know the exact answer (or someone who decided to investigate it).

this should work in all cases

webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default; }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

Also vouch for the code, working as expected for now

@senttohxll
Copy link

is it dangerous to use experiments on my main?

Nope. If you read the code, there’s nothing that it can do to steal your account. Also it’s not against tos

@senttohxll
Copy link

Pretty sure it’s entirely not against tos.

@Maple38
Copy link

Maple38 commented Feb 14, 2023

is it dangerous to use experiments on my main?

Absolutely. We can't say for sure that using them is safe, after all you have to enter this code to be able to use it in the first place unless you are discord staff. So it's best to assume yes.

I would say that while there is an inherent risk, you should be fine just having them enabled, because lots of people do without being banned. The main area I could see issues arising is if you attempt to bypass server-side permissions, like bigger file uploads without nitro. Changing stuff on the client-side shouldn't cause much issue though.

@Lebbbbb
Copy link

Lebbbbb commented Feb 15, 2023

I cant open up console anymore my config looks like
{ "BACKGROUND_COLOR": "#ffffff", "IS_MAXIMIZED": true, "IS_MINIMIZED": false, "WINDOW_BOUNDS": { "x": 46, "y": 143, "width": 1441, "height": 791 }, "openasar": { "setup": true, "cmdPreset": "perf", "quickstart": true, "multiInstance": false }, "trayBalloonShown": true, "OPEN_ON_STARTUP": false, "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true }

@tenent007963
Copy link

tenent007963 commented Feb 15, 2023

Pretty sure it’s entirely not against tos.

Software in Discord’s services
License to our software. Some of our services allow you to download client software. So long as you comply with these terms, we grant you a worldwide, non-exclusive, personal, and non-assignable license to download, install, and run that software, solely to access our services.

You may not copy, modify, create derivative works based upon, distribute, sell, lease, or sublicense any of our software or services. You also may not reverse engineer or decompile our software or services, attempt to do so, or assist anyone in doing so, unless you have our written consent or applicable law permits it.

Unless my understand of "modify" is incorrect, it writes "you may not modify any of our software or services".

I cant open up console anymore my config looks like { "BACKGROUND_COLOR": "#ffffff", "IS_MAXIMIZED": true, "IS_MINIMIZED": false, "WINDOW_BOUNDS": { "x": 46, "y": 143, "width": 1441, "height": 791 }, "openasar": { "setup": true, "cmdPreset": "perf", "quickstart": true, "multiInstance": false }, "trayBalloonShown": true, "OPEN_ON_STARTUP": false, "DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true }

Have you tried to maybe restart your Discord? Or maybe try to reinstall it?

@0x8008
Copy link

0x8008 commented Feb 17, 2023

this should work in all cases

webpackChunkdiscord_app.push([[0], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default; }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

Thanks, working fine on Canary

@namitsoo
Copy link

Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?

@acendvgnt
Copy link

Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?

This code only enables the Experiments tab and the ability to enable experiments in it. If an experiment doesn't work, it's most likely because Discord is experimenting with it.

@Gersonzao
Copy link

Here is a BetterDiscord plugin for it:

/**
 * @name Experiments
 * @author Maple38
 * @description Enables access to experiments and staff-only options for normal users.
 * @version 1.0.0
 */

let wpRequire

module.exports = class Experiments {
    load() {}

    start = () => {
        
        window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
        let mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
        let usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
        let nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
        try {
            nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
        } catch (e) {}
        let oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
        usermod.exports.default.__proto__.getCurrentUser = () => ({isStaff: () => true})
        nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
        usermod.exports.default.__proto__.getCurrentUser = oldGetUser
    }

    stop = () => {}
}

Put that into a BetterDiscord plugin and it should work. I simply turned the already working code to do it into a plugin that runs when you run Discord. I do not know any Javascript, so I probably won't be able to fix any issues you may have with it. Despite not knowing any Javascript, I somehow got this to work with the power of imagination and spending an hour assaulting my keyboard to fix errors.

If you don't know how to turn it into a plugin, just download this and put it in your plugins folder, which you can find by pressing Windows + R and typing %APPDATA%\BetterDiscord\plugins.

Thank you so much! Can you please upload this to a GitHub repo or something easier for other people to find?

@Battler624
Copy link

Battler624 commented Mar 15, 2023

Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?

It works, its just that the tonemapping isn't great. Its definitely better than standard.

Now I just need a way to make it stick through restarts of discord

@CapitanDirp
Copy link

Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?

It works, its just that the tonemapping isn't great. Its definitely better than standard.

Now I just need a way to make it stick through restarts of discord

You won't be able to do that, because the source code (Discords source code) is loaded every time your reload Discord and you would have to open console and paste it in there automatically if you "wanted it to stick with Discord restarts".

@acendvgnt
Copy link

Thanks for sharing updated code. I'm able to see the experiments but unfortunately the HDR Screen capture option doesn't work anymore, is that right?

It works, its just that the tonemapping isn't great. Its definitely better than standard.
Now I just need a way to make it stick through restarts of discord

You won't be able to do that, because the source code (Discords source code) is loaded every time your reload Discord and you would have to open console and paste it in there automatically if you "wanted it to stick with Discord restarts".

I use Tampermonkey to make it "stick".

@MichaelDavidGK
Copy link

any way to enable experiments that don't show up?

@Aholicknight
Copy link

any way to enable experiments that don't show up?

@MichaelDavidGK what do you mean "not show up"?

@MichaelDavidGK
Copy link

MichaelDavidGK commented Apr 3, 2023

@MichaelDavidGK what do you mean "not show up"?

@Aholicknight

There is list of all Experiments ever:
https://gist.github.com/XYZenix/95de40ff80091c0ff7b0cfd610bd10d7

Some of these are not in Experiments tab

there was a way to edit local storage keys, but it doesn't seem to work for 2021-04_april_fools

@Aholicknight
Copy link

@MichaelDavidGK what do you mean "not show up"?

@Aholicknight

There is list of all Experiments ever: XYZenix/95de40ff80091c0ff7b0cfd610bd10d7

@MichaelDavidGK Do you even know what these experiments do, or are you activating all of them at once and hoping for the best? If you do not know how to show the experiement, then don't bother with this. And most experiments won't work because you do not have access.

@MichaelDavidGK
Copy link

@MichaelDavidGK Do you even know what these experiments do, or are you activating all of them at once and hoping for the best? If you do not know how to show the experiement, then don't bother with this. And most experiments won't work because you do not have access.

@Aholicknight I used to have 2021-04_april_fools enabled, but somehow it doesn't work since discord added 2023-03_april_fools
I had it enabled even tho it was hidden in experiment tab

I am just asking if someone knows another way of enabling them except editing local storage keys

@Aholicknight
Copy link

@Aholicknight I used to have 2021-04_april_fools enabled, but somehow it doesn't work since discord added 2023-03_april_fools I had it enabled even tho it was hidden in experiment tab

I am just asking if someone knows another way of enabling them except editing local storage keys

@MichaelDavidGK then they likely removed the experiment, they do that sometimes

@MichaelDavidGK
Copy link

@MichaelDavidGK then they likely removed the experiment, they do that sometimes

@Aholicknight I know that this might be the case, sadly :(
I hoped maybe someone knows how to check if it is deleted and if so then how to enable it
It's okay if not

@MichaelDavidGK
Copy link

@Aholicknight at least I found files and will implement them myself
If anyone wants them then here is list with links for all sounds including defaults:
https://pastebin.com/MRus2LZT
You can also download from here:
https://drive.google.com/drive/folders/11pvutTAZiIIHOdzWBRjYjhNrrIr0iCNC

@TheZoidMaster
Copy link

Is it safe to use this? Will I get banned? I probably should've asked BEFORE I started using it...

@Gersonzao
Copy link

Is it safe to use this? Will I get banned? I probably should've asked BEFORE I started using it...

Whether it's safe or not, it depends on your point of view. Using it is against the Discord's terms of service, but no one has been banned for it yet

@rozivector
Copy link

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

This code is still working until now. Pay attention when discord updates made, the code might not work in the future due updates.

@PoolloverNathan
Copy link

PoolloverNathan commented May 30, 2023

let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getCurrentUser;
usermod.exports.default.__proto__.getCurrentUser = () => ({hasFlag: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

This code is still working until now. Pay attention when discord updates made, the code might not work in the future due updates.

This now causes an almost-immediate crash due to certain properties not being functions - do not use.

@acendvgnt
Copy link

This now causes an almost-immediate crash due to certain properties not being functions - do not use.

@PoolloverNathan
That code has been broken since December of last year.
Use this instead.

webpackChunkdiscord_app.push([[Math.random()], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default; }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

@Eon48
Copy link

Eon48 commented Jun 8, 2023

I enabled a setting using ctrl-alt-o and now discord keeps crashing almost immediately when I open it on my pc, I've tried uninstalling it and nothing as well, any advice?
Edit: the setting in question was DevTools
Edit 2: Nevermind I figured it out, my dumbass didn't even think to clear the cache

@hapklaar
Copy link

hapklaar commented Sep 6, 2023

I was able to open experimental and tried the HDR stream fix, but it doesn't seem to do anything for me. Should this still be functional?

@securing-ab
Copy link

```js
let wpRequire;
window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
nodes = Object.values(mod.exports.Z._dispatcher._actionHandlers._dependencyGraph.nodes)
try {
    nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({user: {flags: 1}})
} catch (e) {}
oldGetUser = usermod.exports.default.__proto__.getNonImpersonatedCurrentUser;
usermod.exports.default.__proto__.getNonImpersonatedCurrentUser= () => ({isStaff: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getNonImpersonatedCurrentUser= oldGetUser

Uncaught TypeError: Cannot read properties of undefined (reading 'exports')
at :5:27
(anonymous) @ VM933:5

@acendvgnt
Copy link

Uncaught TypeError: Cannot read properties of undefined (reading 'exports') at :5:27 (anonymous) @ VM933:5

@securing-ab
That code has been broken since December of last year.
Use this instead.

@Brazuca87
Copy link

Uncaught TypeError: Cannot read properties of undefined (reading 'exports') at :5:27 (anonymous) @ VM933:5

@securing-ab That code has been broken since December of last year. Use this instead.

ah... well, thanks for that... but that other code was definitely not broken since December... I was using it until last month just fine :)

@plowside
Copy link

plowside commented Dec 1, 2023

This now causes an almost-immediate crash due to certain properties not being functions - do not use.

@PoolloverNathan That code has been broken since December of last year. Use this instead.

webpackChunkdiscord_app.push([[Math.random()], {}, (e) => { module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default; }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

until today, your code worked, now it gives such an error:

VM723:1 Uncaught TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at <anonymous>:1:77
    at e (sentry.e8a5639a79578cb5d3a5.js:1:7629)
    at <anonymous>:1:25

@Mizari-W
Copy link

Mizari-W commented Dec 1, 2023

I found a correction

webpackChunkdiscord_app.push([[Math.random()], {}, (e) => { if(e.c!=undefined){module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default;} }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

@hexagonstudios0
Copy link

I found a correction

webpackChunkdiscord_app.push([[Math.random()], {}, (e) => { if(e.c!=undefined){module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default;} }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

This works as of Dec 6th, 2023.

@Windows200000
Copy link

I found a correction

webpackChunkdiscord_app.push([[Math.random()], {}, (e) => { if(e.c!=undefined){module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default;} }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

Still works, January 13th 24

@ProdPreva1l
Copy link

I found a correction

webpackChunkdiscord_app.push([[Math.random()], {}, (e) => { if(e.c!=undefined){module = Object.values(e.c).find(x => x?.exports?.default?.getUsers).exports.default;} }]);
nodes = Object.values(module._dispatcher._actionHandlers._dependencyGraph.nodes);
try { nodes.find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({ user: { flags: 1 } }); } catch (e) { }
original = [module.getCurrentUser, module.getNonImpersonatedCurrentUser];
module.getCurrentUser = module.getNonImpersonatedCurrentUser = () => ({ isStaff: () => true });
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["OVERLAY_INITIALIZE"]();
[module.getCurrentUser, module.getNonImpersonatedCurrentUser] = original;

Still works, March 22nd, 2024

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