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(() => { app.whenReady().then(() => {
ipcMain.handle("ffmpeg", () => ffmpegPath); ipcMain.handle("ffmpeg", () => ffmpegPath);
ipcMain.handle("argv", () => process.argv);
createWindow(); createWindow();

View file

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

View file

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