Skip to content

Instantly share code, notes, and snippets.

@MeguminSama
Last active July 15, 2024 21:37
Show Gist options
  • Save MeguminSama/2cae24c9e4c335c661fa94e72235d4c4 to your computer and use it in GitHub Desktop.
Save MeguminSama/2cae24c9e4c335c661fa94e72235d4c4 to your computer and use it in GitHub Desktop.
Discord Experiments.js
let cache; webpackChunkdiscord_app.push([["wp_isdev_patch"], {}, r => cache=r.c]);
var UserStore = Object.values(cache).find(m => m?.exports?.default?.getUser).exports.default;
var actions = Object.values(UserStore._dispatcher._actionHandlers._dependencyGraph.nodes);
var user = UserStore.getCurrentUser();
actions.find(n => n.name === "ExperimentStore").actionHandler.CONNECTION_OPEN({
type: "CONNECTION_OPEN", user: {flags: user.flags |= 1}, experiments: [],
});
actions.find(n => n.name === "DeveloperExperimentStore").actionHandler.CONNECTION_OPEN();
webpackChunkdiscord_app.pop(); user.flags &= ~1; "done";
@Zyrenth
Copy link

Zyrenth commented Nov 21, 2023

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

@chrisssj2 you can use the web version, or follow this guide to enable devtools on the stable release or you could download and use any other release other than stable because discord has disabled devtools for stable a long time ago

Here you can download the PTB (64-bit) or canary (64-bit) release for Windows. Hope this helps!

@chrisssj2
Copy link

THanks this works!! been looking for this for months now again!

@Zyrenth
Copy link

Zyrenth commented Feb 29, 2024

Another patch because we love discord:
(as of writing this the update is only pushed to canary and ptb)

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

@MeguminSama
Copy link
Author

@Zyrenth thanks for the patch. Gist has been updated.

@vstudiocode
Copy link

very h

@ag1lebyte
Copy link

How can I make it so I don't have to type this in every time I open Discord?

@MeguminSama
Copy link
Author

@ag1lebyte use a mod like vencord

@NightSprite
Copy link

works as of may 2024

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