
* feat: ServiceWorkerMain * refactor: disconnect remote * handle version_info_ nullptr case * initiate finish request when possible and enumerate errors * explicit name for test method * oops * fix: wait for redundant version to stop before destroying * docs: clarify when undefined is returned * chore: remove extra semicolons
34 lines
1 KiB
Markdown
34 lines
1 KiB
Markdown
# ServiceWorkerMain
|
|
|
|
> An instance of a Service Worker representing a version of a script for a given scope.
|
|
|
|
Process: [Main](../glossary.md#main-process)
|
|
|
|
## Class: ServiceWorkerMain
|
|
|
|
Process: [Main](../glossary.md#main-process)<br />
|
|
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
|
|
|
|
### Instance Methods
|
|
|
|
#### `serviceWorker.isDestroyed()` _Experimental_
|
|
|
|
Returns `boolean` - Whether the service worker has been destroyed.
|
|
|
|
#### `serviceWorker.startTask()` _Experimental_
|
|
|
|
Returns `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.
|
|
|
|
### Instance Properties
|
|
|
|
#### `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.
|