mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 21:33:35 -05:00
Will Reporter Explode With This?
This commit is contained in:
parent
a8a0146765
commit
4936e5ec2e
1 changed files with 14 additions and 12 deletions
|
@ -44,8 +44,6 @@ const browser = await pup.launch({
|
||||||
});
|
});
|
||||||
|
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36");
|
|
||||||
await page.setBypassCSP(true);
|
|
||||||
|
|
||||||
async function maybeGetError(handle: JSHandle): Promise<string | undefined> {
|
async function maybeGetError(handle: JSHandle): Promise<string | undefined> {
|
||||||
return await (handle as JSHandle<Error>)?.getProperty("message")
|
return await (handle as JSHandle<Error>)?.getProperty("message")
|
||||||
|
@ -184,6 +182,10 @@ async function printReport() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"),
|
||||||
|
|
||||||
|
page.setBypassCSP(true),
|
||||||
|
|
||||||
page.on("console", async e => {
|
page.on("console", async e => {
|
||||||
const level = e.type();
|
const level = e.type();
|
||||||
const rawArgs = e.args();
|
const rawArgs = e.args();
|
||||||
|
@ -301,7 +303,16 @@ await Promise.all([
|
||||||
} else {
|
} else {
|
||||||
report.ignoredErrors.push(e.message);
|
report.ignoredErrors.push(e.message);
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
|
|
||||||
|
page.evaluateOnNewDocument(`
|
||||||
|
if (location.host.endsWith("discord.com")) {
|
||||||
|
${readFileSync("./dist/browser/browser.js", "utf-8")};
|
||||||
|
(${reporterRuntime.toString()})(${JSON.stringify(process.env.DISCORD_TOKEN)});
|
||||||
|
}
|
||||||
|
`),
|
||||||
|
|
||||||
|
page.goto(CANARY ? "https://canary.discord.com/login" : "https://discord.com/login")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
async function reporterRuntime(token: string) {
|
async function reporterRuntime(token: string) {
|
||||||
|
@ -313,12 +324,3 @@ async function reporterRuntime(token: string) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await page.evaluateOnNewDocument(`
|
|
||||||
if (location.host.endsWith("discord.com")) {
|
|
||||||
${readFileSync("./dist/browser/browser.js", "utf-8")};
|
|
||||||
(${reporterRuntime.toString()})(${JSON.stringify(process.env.DISCORD_TOKEN)});
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
await page.goto(CANARY ? "https://canary.discord.com/login" : "https://discord.com/login");
|
|
||||||
|
|
Loading…
Reference in a new issue