mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-17 18:37:04 -04:00
Kill unsafe require
This commit is contained in:
parent
98cfa090d4
commit
7e526e4172
3 changed files with 0 additions and 18 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue