aboutsummaryrefslogtreecommitdiff
path: root/src/preload.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-08-29 02:25:27 +0200
committerVendicated <vendicated@riseup.net>2022-08-29 02:25:27 +0200
commitaf498e78291b67377aaf876c84143cdfe7c8b308 (patch)
tree091f03c5a78823de12ddd1f4ab60e2fe0ddb4803 /src/preload.ts
downloadVencord-af498e78291b67377aaf876c84143cdfe7c8b308.tar.gz
Vencord-af498e78291b67377aaf876c84143cdfe7c8b308.tar.bz2
Vencord-af498e78291b67377aaf876c84143cdfe7c8b308.zip
Rewrite
Diffstat (limited to 'src/preload.ts')
-rw-r--r--src/preload.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/preload.ts b/src/preload.ts
new file mode 100644
index 0000000..0fc7430
--- /dev/null
+++ b/src/preload.ts
@@ -0,0 +1,14 @@
+import { contextBridge, webFrame } from "electron";
+import { readFileSync } from "fs";
+import { join } from "path";
+import Vencord from "./Vencord";
+
+contextBridge.exposeInMainWorld("VencordNative", {
+ getSettings: () => "hi"
+});
+
+webFrame.executeJavaScript(readFileSync(join(__dirname, "renderer.js"), "utf-8"));
+
+require(process.env.DISCORD_PRELOAD!);
+
+window.onload = () => console.log("hi"); \ No newline at end of file