Last active
April 24, 2025 05:37
-
Star
(328)
You must be signed in to star a gist -
Fork
(13)
You must be signed in to fork a gist
-
-
Save MeguminSama/2cae24c9e4c335c661fa94e72235d4c4 to your computer and use it in GitHub Desktop.
Discord Experiments.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
I tried digging inside the Discord Canary client to try and figure out a way to do it, but I couldn't figure it out.
I am not the most knowledgeable in JS RE or the inner workings of the Discord client in general, maybe someone else might figure it out.
I played around with Zere's Plugin Library since it hosts some helper functions to get experiments and stuff like that, but apparently the ExperimentStore gets created after the experiments get enabled on the client, so it might be something else that's causing the issue (maybe something related to changing user flags?)
megu
megu
megu
Fixed version as of 4/21/2025: https://gist.github.com/MPThLee/3ccb554b9d882abc6313330e38e5dfaa?permalink_comment_id=5550010#gistcomment-5550010
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it could be worth grabbing the current experiments list and reinserting that into the CONNECTION_OPEN payload