Enable process sandboxing (#1206)

This commit is contained in:
V
2025-12-24 15:30:18 +01:00
committed by GitHub
parent 82fb7a6a6d
commit 71bfcecbe6
10 changed files with 87 additions and 73 deletions
+14 -1
View File
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { mkdirSync } from "fs";
import { mkdirSync, readFileSync } from "fs";
import { access, constants as FsConstants, writeFile } from "fs/promises";
import { VENCORD_FILES_DIR } from "main/vencordFilesDir";
import { join } from "path";
@@ -75,3 +75,16 @@ export async function ensureVencordFiles() {
await Promise.all([downloadVencordFiles(), writeFile(join(VENCORD_FILES_DIR, "package.json"), "{}")]);
}
// TODO: remove this once enough time has passed
export function vencordSupportsSandboxing() {
const supports = readFileSync(join(VENCORD_FILES_DIR, "vencordDesktopMain.js"), "utf-8").includes(
"VencordGetRendererCss"
);
if (!supports) {
console.warn(
"⚠️ [VencordLoader] Vencord version is outdated and does not support sandboxing. Please update Vencord to the latest version."
);
}
return supports;
}