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(() => {
|
app.whenReady().then(() => {
|
||||||
ipcMain.handle("ffmpeg", () => ffmpegPath);
|
ipcMain.handle("ffmpeg", () => ffmpegPath);
|
||||||
|
ipcMain.handle("argv", () => process.argv);
|
||||||
|
|
||||||
createWindow();
|
createWindow();
|
||||||
|
|
||||||
|
|
|
@ -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"),
|
||||||
});
|
});
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue