remove legacy code
This commit is contained in:
@@ -35,9 +35,6 @@ import { isDeckGameMode, showGamePage } from "./utils/steamOS";
|
||||
import { isValidVencordInstall } from "./utils/vencordLoader";
|
||||
import { VENCORD_FILES_DIR } from "./vencordFilesDir";
|
||||
|
||||
handleSync(IpcEvents.DEPRECATED_GET_VENCORD_PRELOAD_SCRIPT_PATH, () =>
|
||||
join(VENCORD_FILES_DIR, "vencordDesktopPreload.js")
|
||||
);
|
||||
handleSync(IpcEvents.GET_VENCORD_PRELOAD_SCRIPT, () =>
|
||||
readFileSync(join(VENCORD_FILES_DIR, "vencordDesktopPreload.js"), "utf-8")
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ import { destroyTray, initTray } from "./tray";
|
||||
import { clearData } from "./utils/clearData";
|
||||
import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally";
|
||||
import { applyDeckKeyboardFix, askToApplySteamLayout, isDeckGameMode } from "./utils/steamOS";
|
||||
import { downloadVencordFiles, ensureVencordFiles, vencordSupportsSandboxing } from "./utils/vencordLoader";
|
||||
import { downloadVencordFiles, ensureVencordFiles } from "./utils/vencordLoader";
|
||||
import { VENCORD_FILES_DIR } from "./vencordFilesDir";
|
||||
|
||||
let isQuitting = false;
|
||||
@@ -326,7 +326,7 @@ function buildBrowserWindowOptions(): BrowserWindowConstructorOptions {
|
||||
backgroundColor,
|
||||
webPreferences: {
|
||||
nodeIntegration: false,
|
||||
sandbox: vencordSupportsSandboxing(),
|
||||
sandbox: true,
|
||||
contextIsolation: true,
|
||||
devTools: true,
|
||||
preload: join(__dirname, "preload.js"),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { mkdirSync, readFileSync } from "fs";
|
||||
import { mkdirSync } from "fs";
|
||||
import { access, constants as FsConstants, writeFile } from "fs/promises";
|
||||
import { VENCORD_FILES_DIR } from "main/vencordFilesDir";
|
||||
import { join } from "path";
|
||||
@@ -75,16 +75,3 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user