get argv
This commit is contained in:
parent
8829b9fe92
commit
b055aad397
3 changed files with 9 additions and 1 deletions
|
@ -17,6 +17,7 @@ const createWindow = () => {
|
|||
|
||||
app.whenReady().then(() => {
|
||||
ipcMain.handle("ffmpeg", () => ffmpegPath);
|
||||
ipcMain.handle("argv", () => process.argv);
|
||||
|
||||
createWindow();
|
||||
|
||||
|
|
|
@ -2,4 +2,5 @@ import { contextBridge, ipcRenderer } from "electron";
|
|||
|
||||
contextBridge.exposeInMainWorld("internals", {
|
||||
ffmpeg: () => ipcRenderer.invoke("ffmpeg"),
|
||||
argv: () => ipcRenderer.invoke("argv"),
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue