Skip to main content

IpcMainEvent 对象继承自 Event

🌐 IpcMainEvent Object extends Event

  • type String - 可能的值包括 frame
  • processId Integer - 发送此消息的渲染器进程的内部ID
  • frameId Integer - 发送此消息的渲染器框架的ID
  • returnValue any - 将此设置为在同步消息中返回的值
  • sender WebContents - 返回发送消息的 webContents
  • senderFrame WebFrameMain | null Readonly - 发送此消息的框架。如果在框架导航或被销毁后访问,可能是 null
  • ports MessagePortMain[] - 随此消息传递的 MessagePorts 列表
  • reply Function - 一个函数,将向发送原始消息的渲染器框架发送 IPC 消息。你应该使用此方法“回复”已发送的消息,以保证回复将发送到正确的进程和框架。
    • channel 字符串
    • ...args any[]