aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-09-01 22:35:43 +0200
committerVendicated <vendicated@riseup.net>2022-09-01 22:35:43 +0200
commitd4eadf9348d480cd204a5e1ff440fd26db20bb8e (patch)
tree60c29e59be7079dea936345c5c64f43eb304512c
parent9951e0bcc51cc8eabfbbce81e4671f94fd433513 (diff)
downloadVencord-d4eadf9348d480cd204a5e1ff440fd26db20bb8e.tar.gz
Vencord-d4eadf9348d480cd204a5e1ff440fd26db20bb8e.tar.bz2
Vencord-d4eadf9348d480cd204a5e1ff440fd26db20bb8e.zip
BrowserWindow: Disable sandbox to fix electron>=21
-rw-r--r--README.md2
-rw-r--r--src/patcher.ts1
2 files changed, 2 insertions, 1 deletions
diff --git a/README.md b/README.md
index a61deb5..c2a7a47 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ My own Discord Desktop mod :)
## Features
-- Proper context isolation -> Works in newer Electron versions
+- Proper context isolation -> Works in newer Electron versions (Confirmed working on versions 13-21)
- Inline patches: Patch Discord's code with regex replacements! See [the experiments plugin](src/plugins/experiments.ts) for an example. While being more complex, this is more powerful than monkey patching since you can patch only small parts of functions instead of fully replacing them, access non exported/local variables and even replace constants (like in the aforementioned experiments patch!)
- Custom Css: Manually edit `%appdata%/Vencord/settings/quickCss.css` / `~/.config/Vencord/settings/quickCss.css` with your favourite editor and the client will automatically apply your changes
diff --git a/src/patcher.ts b/src/patcher.ts
index 7d3f821..8cd8678 100644
--- a/src/patcher.ts
+++ b/src/patcher.ts
@@ -11,6 +11,7 @@ class BrowserWindow extends electron.BrowserWindow {
if (options?.webPreferences?.preload && options.title) {
const original = options.webPreferences.preload;
options.webPreferences.preload = join(__dirname, "preload.js");
+ options.webPreferences.sandbox = false;
process.env.DISCORD_PRELOAD = original;