From a8678db78c63d1981274f452045ccabe4cf6079d Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 12 Jan 2023 04:44:00 +0100 Subject: Fix React DevTools --- src/ipcMain/extensions.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ipcMain/extensions.ts b/src/ipcMain/extensions.ts index 0e26ff1..d8f8437 100644 --- a/src/ipcMain/extensions.ts +++ b/src/ipcMain/extensions.ts @@ -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); -- cgit