fix(javascript): trace wrapped Electron IPC paths in large bundles (#1874)
Co-authored-by: David <17119984+fengdwx@users.noreply.github.com>
This commit is contained in:
@@ -175,7 +175,7 @@ const addValidation = (
|
||||
});
|
||||
};
|
||||
|
||||
const ipcDescriptor = (
|
||||
export const ipcDescriptor = (
|
||||
path: readonly string[] | undefined,
|
||||
): ElectronIpcDescriptor | undefined => {
|
||||
if (path?.length !== 2) return undefined;
|
||||
@@ -201,6 +201,7 @@ const ipcDescriptor = (
|
||||
operation: "send-to-host",
|
||||
mode: "send",
|
||||
};
|
||||
case "addListener":
|
||||
case "on":
|
||||
return { side: "renderer", operation: "on", mode: "listen" };
|
||||
case "once":
|
||||
@@ -209,6 +210,7 @@ const ipcDescriptor = (
|
||||
}
|
||||
const main = object === "ipcMain" ? operation : undefined;
|
||||
switch (main) {
|
||||
case "addListener":
|
||||
case "on":
|
||||
return { side: "main", operation: "on", mode: "listen" };
|
||||
case "once":
|
||||
|
||||
Reference in New Issue
Block a user