diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-01 17:05:18 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-01 17:05:18 +0200 |
commit | cac77dce406be92755519be595cf460e8f758b16 (patch) | |
tree | 56c38a31c391b76b56e71ab2567442e2dec09198 /src/ipcMain.ts | |
parent | be94dbbc6c7a26f5cf44408c25ce1072c3c4f675 (diff) | |
download | Vencord-cac77dce406be92755519be595cf460e8f758b16.tar.gz Vencord-cac77dce406be92755519be595cf460e8f758b16.tar.bz2 Vencord-cac77dce406be92755519be595cf460e8f758b16.zip |
Fix DiscordNative.desktopCapture.getDesktopCaptureSources() in electron17+
Diffstat (limited to 'src/ipcMain.ts')
-rw-r--r-- | src/ipcMain.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ipcMain.ts b/src/ipcMain.ts index 9795ff1..89c49ab 100644 --- a/src/ipcMain.ts +++ b/src/ipcMain.ts @@ -2,7 +2,7 @@ import { execFile as cpExecFile } from 'child_process'; import { createHash } from "crypto"; -import { app, BrowserWindow, ipcMain, shell } from "electron"; +import { app, BrowserWindow, desktopCapturer, ipcMain, shell } from "electron"; import { createReadStream, mkdirSync, readFileSync, watch } from "fs"; import { open, readFile, writeFile } from "fs/promises"; import { join } from 'path'; @@ -76,6 +76,7 @@ function serializeErrors(func: (...args: any[]) => any) { }; } +ipcMain.handle(IpcEvents.GET_DESKTOP_CAPTURE_SOURCES, (_, opts) => desktopCapturer.getSources(opts)); ipcMain.handle(IpcEvents.GET_SETTINGS_DIR, () => SETTINGS_DIR); ipcMain.handle(IpcEvents.GET_QUICK_CSS, () => readCss()); ipcMain.handle(IpcEvents.OPEN_PATH, (_, ...pathElements) => shell.openPath(join(...pathElements))); |