This commit is contained in:
Mylloon 2023-07-29 20:20:55 +02:00
parent 8829b9fe92
commit b055aad397
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 9 additions and 1 deletions

View file

@ -17,6 +17,7 @@ const createWindow = () => {
app.whenReady().then(() => {
ipcMain.handle("ffmpeg", () => ffmpegPath);
ipcMain.handle("argv", () => process.argv);
createWindow();

View file

@ -2,4 +2,5 @@ import { contextBridge, ipcRenderer } from "electron";
contextBridge.exposeInMainWorld("internals", {
ffmpeg: () => ipcRenderer.invoke("ffmpeg"),
argv: () => ipcRenderer.invoke("argv"),
});

View file

@ -1,11 +1,17 @@
/* Context bridge */
let internals: {
ffmpeg: () => Promise<string>;
argv: () => Promise<string>;
};
const get_ffmpeg = async () => {
const response = await internals.ffmpeg();
console.log(response);
};
get_ffmpeg();
const get_argv = async () => {
const response = await internals.argv();
console.log(response);
};
get_argv();