ServiceWorker🧪
✅️️ Methods
🔨ServiceWorker.deliverPushMessage
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| origin | ✔️ | string | |||
| registrationId | ✔️ | RegistrationID | |||
| data | ✔️ | string |
🔨ServiceWorker.disable
🔨ServiceWorker.dispatchPeriodicSyncEvent
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| origin | ✔️ | string | |||
| registrationId | ✔️ | RegistrationID | |||
| tag | ✔️ | string |
🔨ServiceWorker.dispatchSyncEvent
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| origin | ✔️ | string | |||
| registrationId | ✔️ | RegistrationID | |||
| tag | ✔️ | string | |||
| lastChance | ✔️ | boolean |
🔨ServiceWorker.enable
🔨ServiceWorker.setForceUpdateOnPageLoad
| 参数 | 必填 | 标记 | 类 型 | 描述 | 原文 |
|---|---|---|---|---|---|
| forceUpdateOnPageLoad | ✔️ | boolean |
🔨ServiceWorker.skipWaiting
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| scopeURL | ✔️ | string |
🔨ServiceWorker.startWorker
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| scopeURL | ✔️ | string |
🔨ServiceWorker.stopAllWorkers
🔨ServiceWorker.stopWorker
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| versionId | ✔️ | string |
🔨ServiceWorker.unregister
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| scopeURL | ✔️ | string |
🔨ServiceWorker.updateRegistration
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| scopeURL | ✔️ | string |
✅️️ Events
👋ServiceWorker.workerErrorReported
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| errorMessage | ✔️ | ServiceWorkerErrorMessage |
👋ServiceWorker.workerRegistrationUpdated
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| registrations | ✔️ | array[ServiceWorkerRegistration] |
👋ServiceWorker.workerVersionUpdated
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| versions | ✔️ | array[ServiceWorkerVersion] |
✅️️ Types
📌ServiceWorker.RegistrationID
返回类型:string
📌ServiceWorker.ServiceWorkerErrorMessage
ServiceWorker 错误信息。
EN
ServiceWorker error message.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| errorMessage | ✔️ | string | |||
| registrationId | ✔️ | RegistrationID | |||
| versionId | ✔️ | string | |||
| sourceURL | ✔️ | string | |||
| lineNumber | ✔️ | integer | |||
| columnNumber | ✔️ | integer |
📌ServiceWorker.ServiceWorkerRegistration
ServiceWorker ''registration``。
EN
ServiceWorker registration.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| registrationId | ✔️ | RegistrationID | |||
| scopeURL | ✔️ | string | |||
| isDeleted | ✔️ | boolean |
📌ServiceWorker.ServiceWorkerVersion
ServiceWorker ''版本''。
EN
ServiceWorker version.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| versionId | ✔️ | string | |||
| registrationId | ✔️ | RegistrationID | |||
| scriptURL | ✔️ | string | |||
| runningStatus | ✔️ | ServiceWorkerVersionRunningStatus | |||
| status | ✔️ | ServiceWorkerVersionStatus | |||
| scriptLastModified | number | 主脚本的''Last-Modified''头信息值。 | ENThe Last-Modified header value of the main script. | ||
| scriptResponseTime | number | 主脚本的响应头从服务器接收的时间。对于缓存的脚本,这是缓存条目最后一次被验证的时间。 | ENThe time at which the response headers of the main script were received from the server. For cached script it is the last time the cache entry was validated. | ||
| controlledClients | array[Target.TargetID] | ||||
| targetId | Target.TargetID | ||||
| routerRules | string |
📌ServiceWorker.ServiceWorkerVersionRunningStatus
允许的值:stopped、starting、running、stopping
EN
Allowed Values:
stopped, starting, running, stopping返回类型:string
📌ServiceWorker.ServiceWorkerVersionStatus
允许的值:new、installing、installed、activating、activated、redundant
EN
Allowed Values:
new, installing, installed, activating, activated, redundant返回类型 :string