Options
All
  • Public
  • Public/Protected
  • All
Menu

运行在主线程中的远程控制插件

Hierarchy

  • RemoteControllerBase
    • RemoteControllerWindow

Implements

  • WindowPlugin

Index

Constructors

Properties

configBackup: string
context: UseContext
fetchConfigThrottle: () => Promise<RemoteConfig>

Type declaration

name: "@glacierjs/plugin-remote-controller" = PLUGIN_NAME
options: Options = ...

Methods

  • beforeRegister(): Promise<void>
  • 在主线程中注册 ServiceWorker 之前检查远程配置。 该代码会在页面刷新时执行,所以会存在两种情况:

    1. ServiceWorker 已注册,远程配置开关关闭:注销当前运行的 ServiceWorker
    2. ServiceWorker 第一次注册,远程配置开关关闭:阻断注册流程,不下载 ServiceWorker 文件。

    Returns Promise<void>

  • getConfig(): Promise<{ config: RemoteConfig; configUpdated: boolean }>
  • onUse(context: UseContext): void

Generated using TypeDoc