ServiceWorkerMain
An instance of a Service Worker representing a version of a script for a given scope.
Process: Main
Class: ServiceWorkerMain
Process: Main
_This class is not exported from the 'electron'
module. Electron API の他のメソッドの戻り値としてのみ利用できます。
インスタンスメソッド
serviceWorker.isDestroyed()
Experimental
Returns boolean
- Whether the service worker has been destroyed.
serviceWorker.send(channel, ...args)
Experimental
channel
string...args
any[]
Send an asynchronous message to the service worker process via channel
, along with
arguments. Arguments will be serialized with the Structured Clone Algorithm,
just like postMessage
, so prototype chains will not be included.
関数、Promise、Symbol、WeakMap、WeakSet の送信は、例外が送出されます。
The service worker process can handle the message by listening to channel
with the
ipcRenderer
module.
serviceWorker.startTask()
Experimental
戻り地 Object
:
end
Function - Method to call when the task has ended. If never called, the service won't terminate while otherwise idle.
Initiate a task to keep the service worker alive until ended.
インスタンスプロパティ
serviceWorker.ipc
Readonly Experimental
An IpcMainServiceWorker
instance scoped to the service worker.
serviceWorker.scope
Readonly Experimental
A string
representing the scope URL of the service worker.
serviceWorker.versionId
Readonly Experimental
A number
representing the ID of the specific version of the service worker script in its scope.