Skip to content

Instantly share code, notes, and snippets.

@JohannesMP
Forked from ExordiumX/betaenabler.js
Last active May 6, 2024 19:15
Show Gist options
  • Star 111 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • 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

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

@SparkyCloudy
Copy link

@roshantaneja
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 = () => ({isStaff: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

this one still works on stable

@GitThisBugOff
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 = () => ({isStaff: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler["CONNECTION_OPEN"]()
usermod.exports.default.__proto__.getCurrentUser = oldGetUser

this one still works on stable

Still works on stable as of this date.

@thetoasta
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 = () => ({isStaff: () => true})
nodes.find(x => x.name == "DeveloperExperimentStore").actionHandler"CONNECTION_OPEN"
usermod.exports.default.proto.getCurrentUser = oldGetUser

works with betterdiscord, me personally i use Discord PTB so it works with that also.

@Dev-384
Copy link

Dev-384 commented Aug 8, 2023

CONSOLE 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 } );
ERROR:
VM2254:1 Uncaught TypeError: Cannot read properties of undefined (reading 'exports') at <anonymous>:1:159

@zoeeechu
Copy link

CONSOLE 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 } ); ERROR: VM2254:1 Uncaught TypeError: Cannot read properties of undefined (reading 'exports') at <anonymous>:1:159

webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=Object.values(r.c)]); var UserStore = cache.find(m => m?.exports?.default?.getCurrentUser).exports.default; var actions = UserStore._dispatcher._actionHandlers._orderedActionHandlers["CONNECTION_OPEN"]; var user = UserStore.getCurrentUser(); actions.find(n => n.name === "ExperimentStore").actionHandler({ type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [], }); actions.find(n => n.name === "DeveloperExperimentStore").actionHandler(); webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";

@SturdyStubs
Copy link

SturdyStubs commented Aug 16, 2023

Console code:

Uncaught TypeError: Cannot read properties of undefined (reading 'find')
    at <anonymous>:1:316
(anonymous) @ VM787:1

@germandreym
Copy link

can you get banned for using it?

@Like4Schnitzel
Copy link

can you get banned for using it?

Any modification to the client is a TOS violation, including as much as editing HTML. However, since this is a purely local change, it won't be detectable. I don't know if there are any experiments that send data which would make it identifyable you enabled them. As far as local-only experiements go, you'll be fine so long as you don't go bragging about them to Discord staff.

@Aholicknight
Copy link

image

Discord Experiments has broken once again after a major discord update. Wonder how long this will take to fix.

@Futuremappermydud
Copy link

Futuremappermydud commented Oct 27, 2023

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

@MackenzieGB
Copy link

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

Yeah! It works!

@Aholicknight
Copy link

Aholicknight commented Oct 28, 2023

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

Yes this does work, thank you! Now what would I have to replace in my plugin to make it work? This is my old plugin:

/**
 * @name discordExperimentsfixed
 * @description Enables the experiments tab in discord's settings.
 * @author Aholicknight
 * @version 1.3.3.7
 */

const settingsStore = BdApi.findModule(m => typeof m?.default?.isDeveloper !== "undefined");
const userStore = BdApi.findModule(m => m?.default?.getUsers);

module.exports = class {
    getName() {
        return "Discord Experiments Fixed";
    }

    start() {
        let wpRequire;
        window.webpackChunkdiscord_app.push([[Math.random()], {}, (req) => {
            wpRequire = req;
        }]);
        let mod;
        mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
        let usermod;
        usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
        let nodes;
        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;
        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() {
        Object.values(settingsStore.default._dispatcher._dependencyGraph.nodes).find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({
            user: {flags: 0},
            type: "CONNECTION_OPEN"
        })
    }
};

EDIT: Fixed it

@Bull3t0
Copy link

Bull3t0 commented Nov 1, 2023

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

Yes this does work, thank you! Now what would I have to replace in my plugin to make it work? This is my old plugin:

/**
 * @name discordExperimentsfixed
 * @description Enables the experiments tab in discord's settings.
 * @author Aholicknight
 * @version 1.3.3.7
 */

const settingsStore = BdApi.findModule(m => typeof m?.default?.isDeveloper !== "undefined");
const userStore = BdApi.findModule(m => m?.default?.getUsers);

module.exports = class {
    getName() {
        return "Discord Experiments Fixed";
    }

    start() {
        let wpRequire;
        window.webpackChunkdiscord_app.push([[Math.random()], {}, (req) => {
            wpRequire = req;
        }]);
        let mod;
        mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
        let usermod;
        usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
        let nodes;
        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;
        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() {
        Object.values(settingsStore.default._dispatcher._dependencyGraph.nodes).find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({
            user: {flags: 0},
            type: "CONNECTION_OPEN"
        })
    }
};

EDIT: Fixed it

Can get the regular working but the plugin doesn't work

@bobbyl140
Copy link

Can get the regular working but the plugin doesn't work

Same, I pasted the code into a blank BD plugin and it says that c is not defined so clearly the BD plugin loader doesn't expect this format. I would fix it but I'm not that good at JS.

@iy9k
Copy link

iy9k commented Nov 20, 2023

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

Yes this does work, thank you! Now what would I have to replace in my plugin to make it work? This is my old plugin:

/**
 * @name discordExperimentsfixed
 * @description Enables the experiments tab in discord's settings.
 * @author Aholicknight
 * @version 1.3.3.7
 */

const settingsStore = BdApi.findModule(m => typeof m?.default?.isDeveloper !== "undefined");
const userStore = BdApi.findModule(m => m?.default?.getUsers);

module.exports = class {
    getName() {
        return "Discord Experiments Fixed";
    }

    start() {
        let wpRequire;
        window.webpackChunkdiscord_app.push([[Math.random()], {}, (req) => {
            wpRequire = req;
        }]);
        let mod;
        mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
        let usermod;
        usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
        let nodes;
        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;
        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() {
        Object.values(settingsStore.default._dispatcher._dependencyGraph.nodes).find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({
            user: {flags: 0},
            type: "CONNECTION_OPEN"
        })
    }
};

EDIT: Fixed it

what did you do to fix it?

@chrisssj2
Copy link

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

How? ctrl+SHIFT+I doesn't open console. so what do you do with this code?

@RaspberryKitty1
Copy link

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

Yes this does work, thank you! Now what would I have to replace in my plugin to make it work? This is my old plugin:

/**
 * @name discordExperimentsfixed
 * @description Enables the experiments tab in discord's settings.
 * @author Aholicknight
 * @version 1.3.3.7
 */

const settingsStore = BdApi.findModule(m => typeof m?.default?.isDeveloper !== "undefined");
const userStore = BdApi.findModule(m => m?.default?.getUsers);

module.exports = class {
    getName() {
        return "Discord Experiments Fixed";
    }

    start() {
        let wpRequire;
        window.webpackChunkdiscord_app.push([[Math.random()], {}, (req) => {
            wpRequire = req;
        }]);
        let mod;
        mod = Object.values(wpRequire.c).find(x => typeof x?.exports?.Z?.isDeveloper !== "undefined");
        let usermod;
        usermod = Object.values(wpRequire.c).find(x => x?.exports?.default?.getUsers)
        let nodes;
        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;
        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() {
        Object.values(settingsStore.default._dispatcher._dependencyGraph.nodes).find(x => x.name == "ExperimentStore").actionHandler["OVERLAY_INITIALIZE"]({
            user: {flags: 0},
            type: "CONNECTION_OPEN"
        })
    }
};

EDIT: Fixed it

what did you do to fix it?

image

@RaspberryKitty1
Copy link

c = webpackChunkdiscord_app.push([[Symbol()],{},({c})=>Object.values(c)]);
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()

this works

Yeah! It works!

image
broken now

@Aholicknight
Copy link

Yup the plugin broke again. Need to wait for a fix

@Soleanna
Copy link

Soleanna commented Dec 6, 2023

loading the inspector for some reason forcibly logs me out, not sure if this is new or not...

@MedlockC
Copy link

MedlockC commented Dec 7, 2023

I took a crack at this, but I don't know if this fix will work for everyone, and could likely be optimized by people who understand this a bit more.

let wpRequire;
webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
u = Object.values(wpRequire.c).find((x)=> x?.exports?.default?.getCurrentUser && x?.exports?.default?._dispatcher?._actionHandlers).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()

@Like4Schnitzel
Copy link

Fixes it for me. However, interestingly, it doesn't work on (re)load when used in the start() method of a plugin. After manually disabling and re-enabling the plugin, the experiments tab does appear though.

@Ayimforgoroldacc
Copy link

Ayimforgoroldacc commented Dec 7, 2023

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()

@ChrisZeThird
Copy link

Got the following error:

Uncaught TypeError: Cannot redefine property: isDeveloper
    at Function.defineProperty (<anonymous>)
    at <anonymous>:1:8```

@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