aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-05 14:20:34 +0200
committerVendicated <vendicated@riseup.net>2022-10-05 14:30:21 +0200
commit7e526e4172412eba720ffd1fa34511046ef47e6b (patch)
tree05587f306688ff65e9d5cfa96ddb31bc5a238518
parent98cfa090d4fcdf5ed934cf7435df9423fbe58932 (diff)
downloadVencord-7e526e4172412eba720ffd1fa34511046ef47e6b.tar.gz
Vencord-7e526e4172412eba720ffd1fa34511046ef47e6b.tar.bz2
Vencord-7e526e4172412eba720ffd1fa34511046ef47e6b.zip
Kill unsafe require
-rw-r--r--src/VencordNative.ts9
-rw-r--r--src/api/settings.ts2
-rw-r--r--src/components/Settings.tsx7
3 files changed, 0 insertions, 18 deletions
diff --git a/src/VencordNative.ts b/src/VencordNative.ts
index 33bb869..494e9ff 100644
--- a/src/VencordNative.ts
+++ b/src/VencordNative.ts
@@ -27,14 +27,5 @@ export default {
assertEventAllowed(event);
return ipcRenderer.invoke(event, ...args);
}
- },
- require(mod: string) {
- const settings = ipcRenderer.sendSync(IPC_EVENTS.GET_SETTINGS);
- try {
- if (!JSON.parse(settings).unsafeRequire) throw "no";
- } catch {
- throw new Error("Unsafe require is not allowed. Enable it in settings and try again.");
- }
- return require(mod);
}
};
diff --git a/src/api/settings.ts b/src/api/settings.ts
index 17f3f12..3328323 100644
--- a/src/api/settings.ts
+++ b/src/api/settings.ts
@@ -5,7 +5,6 @@ import { mergeDefaults } from '../utils/misc';
interface Settings {
notifyAboutUpdates: boolean;
- unsafeRequire: boolean;
useQuickCss: boolean;
plugins: {
[plugin: string]: {
@@ -17,7 +16,6 @@ interface Settings {
const DefaultSettings: Settings = {
notifyAboutUpdates: true,
- unsafeRequire: false,
useQuickCss: true,
plugins: {}
};
diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx
index 007767e..4e0196f 100644
--- a/src/components/Settings.tsx
+++ b/src/components/Settings.tsx
@@ -111,13 +111,6 @@ export default ErrorBoundary.wrap(function Settings() {
>
Get notified about new Updates
</Switch>}
- {!IS_WEB && <Switch
- value={settings.unsafeRequire}
- onChange={(v: boolean) => settings.unsafeRequire = v}
- note="Enables VencordNative.require. Useful for testing, very bad for security. Leave this off unless you need it."
- >
- Enable Unsafe Require
- </Switch>}
<Forms.FormDivider />