Fix Experiments embed patches

This commit is contained in:
Nuckyz 2025-07-14 17:07:43 -03:00
parent 5dd6722528
commit 1a98d54e3a
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -116,11 +116,19 @@ export default definePlugin({
},
// Fix some tricky experiments name causing a client crash
{
match: /.getRegisteredExperiments\(\)(?<=(\i)=.+?).+?if\(null==(\i)(?=\)return null;)/,
replace: "$&||!Object.hasOwn($1,$2)"
match: /.getExperimentBucketName.+?if\(null==(\i)\|\|null==\i(?=\)return null;)/,
replace: "$&||({})[$1]!=null"
}
]
},
// Fix another function which cases crashes with tricky experiment names and the experiment embed
{
find: "}getServerAssignment(",
replacement: {
match: /}getServerAssignment\((\i),\i,\i\){/,
replace: "$&if($1==null)return;"
}
}
],
start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport),