Skip to content

Instantly share code, notes, and snippets.

@RanolP
Last active January 2, 2022 19:49
Show Gist options
  • Save RanolP/d72ac7512a16fdca66b9bd263fc434b3 to your computer and use it in GitHub Desktop.
Save RanolP/d72ac7512a16fdca66b9bd263fc434b3 to your computer and use it in GitHub Desktop.
Bypass Screen Share Restriction in Guild on Discord.
(() => {
const data = [
[],
{
run: (_ignored1, _ignored2, { c: result }) => {
for (const field of Object.getOwnPropertyNames(result)) {
const exported = result[field].exports;
if (exported && exported.isDeveloper === false) {
Object.defineProperty(exported, "isDeveloper", {
value: true,
configurable: true
});
}
}
}
},
[["run"]]
];
if(typeof webpackJsonp === "object") {
webpackJsonp.push(data);
} else {
webpackJsonp(...data);
}
})();
// Remove const to make code shorter
// Rename variable more short
// Remove semicolons if it's not ambigious
a = [
[],
{
b: (d, e, { c }) => {
// Make reused long value as variable
h = "isDeveloper";
for (f of Object.getOwnPropertyNames(c)) {
g = c[f].exports;
if (g && g[h] === false) {
Object.defineProperty(g, h, { value: true, configurable: true })
}
}
}
},
[["b"]]
];
// Change if-else to elvis operator
typeof webpackJsonp == "object" ? webpackJsonp.push(a) : webpackJsonp(...a)
a=[[],{b:(d,e,{c})=>{h="isDeveloper";for(f of Object.getOwnPropertyNames(c)){g=c[f].exports;if(g&&g[h]===false){Object.defineProperty(g,h,{value:true,configurable:true})}}}},[["b"]]];typeof webpackJsonp=="object"?webpackJsonp.push(a):webpackJsonp(...a)
@RanolP
Copy link
Author

RanolP commented May 1, 2019

Some people say it does not work anymore. if you're one of them it would be useful for you.

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