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