跳到主要内容

IpcMainEvent 对象继承自 Event

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