Skip to main content

IpcMainServiceWorkerEvent 对象继承自 Event

🌐 IpcMainServiceWorkerEvent Object extends Event

  • type 字符串 - 可能的取值包括 service-worker
  • serviceWorker ServiceWorkerMain 只读 - 发送此消息的服务工作者
  • versionId 号码 - 服务工作者的版本 ID。
  • session 会话 - 与该事件相关的 Session 实例。
  • returnValue any - Set this to the value to be returned in a synchronous message
  • ports MessagePortMain[] - 随此消息传递的 MessagePorts 列表
  • reply 函数 - 一个函数,用于向发送原始消息的渲染器框架发送 IPC 消息。你应该使用此方法来“回复”发送的消息,以确保回复会发送到正确的进程和框架。
    • channel 字符串
    • ...args any[]