Well you can thank Claude for making this works.
This code should automatically works for later update as it goes through the runtime objects to find the new id for the store, this is quite a bruteforce way of doing it, as of May 30th you can use a simpler version with current ID
{
var wpR = [];
webpackChunkdiscord_app.push([[Symbol()], {}, function(r) { wpR.push(r); }]);
webpackChunkdiscord_app.pop();
var r = wpR[0]; // Discord runtime (not Sentry)
var UserStore = r(287809).default;
var user = UserStore.getCurrentUser();
var nodes = Object.values(UserStore._dispatcher._actionHandlers._dependencyGraph.nodes);
user.flags |= 1;
nodes.find(x => x.name === "DeveloperExperimentStore")?.actionHandler?.CONNECTION_OPEN?.();
var expStore = nodes.find(x => x.name === "ExperimentStore");
try {
expStore.actionHandler.CONNECTION_OPEN({ type: "CONNECTION_OPEN", user: { flags: 1 }, experiments: [] });
} catch {
try { expStore.actionHandler.OVERLAY_INITIALIZE({ user: { flags: 1 } }); } catch(e) {}
}
expStore?.storeDidChange?.();
user.flags &= ~1;
console.log("Done — open Settings → Experiments");
}{
// Step 1: capture both webpack runtimes
var _runtimes = [];
webpackChunkdiscord_app.push([[Symbol()], {}, r => _runtimes.push(r)]);
webpackChunkdiscord_app.pop();
// Step 2: identify the Discord runtime (most factories, not Sentry)
var r = _runtimes.reduce((a, b) =>
Object.keys(a.m ?? {}).length >= Object.keys(b.m ?? {}).length ? a : b
);
if (!r.m) throw new Error("No module factories found — webpack structure may have changed");
// Step 3: find UserStore factory by displayName string
var ids = Object.keys(r.m);
var userStoreId = ids.find(id => {
var s = r.m[id].toString();
return s.includes('displayName="UserStore"') || s.includes("displayName:'UserStore'");
});
if (!userStoreId) {
// Fallback: find by getCurrentUser + mergeUser which are stable UserStore signatures
userStoreId = ids.find(id => {
var s = r.m[id].toString();
return s.includes('getCurrentUser') && s.includes('mergeUser');
});
}
if (!userStoreId) throw new Error("UserStore module not found — search patterns may need updating");
console.log("UserStore module ID:", userStoreId);
// Step 4: load UserStore — try .default first, then .A, then first export value
var userStoreMod = r(userStoreId);
var UserStore = userStoreMod.default
?? userStoreMod.A
?? Object.values(userStoreMod).find(v => typeof v?.getCurrentUser === 'function');
if (!UserStore?.getCurrentUser) throw new Error("UserStore export not found — export key may have changed");
var user = UserStore.getCurrentUser();
if (!user) throw new Error("No current user — are you logged in?");
console.log("User found:", user.id);
// Step 5: get dispatcher nodes
var nodes = Object.values(
UserStore._dispatcher._actionHandlers._dependencyGraph.nodes
);
// Step 6: find experiment stores by name (these names have been stable)
var expStore = nodes.find(x => x.name === "ExperimentStore");
var devExpStore = nodes.find(x => x.name === "DeveloperExperimentStore");
if (!expStore) throw new Error("ExperimentStore not found in dispatcher nodes");
if (!devExpStore) throw new Error("DeveloperExperimentStore not found in dispatcher nodes");
// Step 7: enable
user.flags |= 1;
devExpStore.actionHandler?.CONNECTION_OPEN?.();
try {
expStore.actionHandler.CONNECTION_OPEN({
type: "CONNECTION_OPEN",
user: { flags: 1 },
experiments: []
});
} catch {
try {
expStore.actionHandler.OVERLAY_INITIALIZE({ user: { flags: 1 } });
} catch(e) {
console.warn("Both ExperimentStore triggers failed:", e);
}
}
expStore.storeDidChange?.();
user.flags &= ~1;
console.log("Done — open Settings → Experiments");
}