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