2023-04-04 02:40:03 +00:00
|
|
|
import { contextBridge, ipcRenderer, webFrame } from "electron";
|
2023-04-05 03:31:44 +00:00
|
|
|
import { GET_RENDERER_SCRIPT, GET_RENDERER_STYLES, GET_VENCORD_PRELOAD_FILE } from "../shared/IpcEvents";
|
2023-04-03 23:35:37 +00:00
|
|
|
import { VencordDesktop } from "./VencordDesktop";
|
|
|
|
|
|
|
|
contextBridge.exposeInMainWorld("VencordDesktop", VencordDesktop);
|
2023-03-30 23:21:06 +00:00
|
|
|
|
2023-04-04 02:40:03 +00:00
|
|
|
require(ipcRenderer.sendSync(GET_VENCORD_PRELOAD_FILE));
|
|
|
|
|
|
|
|
webFrame.executeJavaScript(ipcRenderer.sendSync(GET_RENDERER_SCRIPT));
|
2023-04-05 03:31:44 +00:00
|
|
|
ipcRenderer.invoke(GET_RENDERER_STYLES).then(s => webFrame.insertCSS(s));
|