跳转到主要内容

IpcMainEvent 对象 extends Event

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