MCPcopy
hub / github.com/ZToolsCenter/ZTools / ipcInvoke

Function ipcInvoke

resources/preload.js:19–25  ·  view source on GitHub ↗
(apiName, args)

Source from the content-addressed store, hash-verified

17 * 主进程 throw 的错误会被 Electron 包裹,这里去除前缀后重新抛出
18 */
19const ipcInvoke = async (apiName, args) => {
20 try {
21 return await electron.ipcRenderer.invoke('plugin.api', apiName, args)
22 } catch (e) {
23 throw new Error(e.message.replace(/^.*?Error:/, '').trim())
24 }
25}
26
27/**
28 * 单向 IPC 发送 - 通过 plugin.api 通道发送消息,不等待返回值

Callers 2

createZBrowserClientFunction · 0.85
preload.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected