Fix React DevTools
This commit is contained in:
parent
bedb7b212b
commit
a8678db78c
1 changed files with 12 additions and 3 deletions
|
@ -67,9 +67,18 @@ export async function installExt(id: string) {
|
|||
try {
|
||||
await access(extDir, fsConstants.F_OK);
|
||||
} catch (err) {
|
||||
const url = `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=32`;
|
||||
const buf = await get(url);
|
||||
await extract(crxToZip(buf), extDir);
|
||||
const url = id === "fmkadmapgofadopljbjfkapdkoienihi"
|
||||
// React Devtools v4.25
|
||||
// v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843
|
||||
// Unfortunately, Google does not serve old versions, so this is the only way
|
||||
? "https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip"
|
||||
: `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=32`;
|
||||
const buf = await get(url, {
|
||||
headers: {
|
||||
"User-Agent": "Vencord (https://github.com/Vendicated/Vencord)"
|
||||
}
|
||||
});
|
||||
await extract(crxToZip(buf), extDir).catch(console.error);
|
||||
}
|
||||
|
||||
session.defaultSession.loadExtension(extDir);
|
||||
|
|
Loading…
Reference in a new issue