aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-01-12 04:44:00 +0100
committerVendicated <vendicated@riseup.net>2023-01-12 04:44:00 +0100
commita8678db78c63d1981274f452045ccabe4cf6079d (patch)
treef11c17f5a08228b7b8c77bb72b77408debd1edb9 /src
parentbedb7b212bdb3da26294a04b934c8a04be79eda0 (diff)
downloadVencord-a8678db78c63d1981274f452045ccabe4cf6079d.tar.gz
Vencord-a8678db78c63d1981274f452045ccabe4cf6079d.tar.bz2
Vencord-a8678db78c63d1981274f452045ccabe4cf6079d.zip
Fix React DevTools
Diffstat (limited to 'src')
-rw-r--r--src/ipcMain/extensions.ts15
1 files changed, 12 insertions, 3 deletions
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);