trait ServiceWorkerRegistration extends EventTarget
The ServiceWorkerRegistion interface of the ServiceWorker API represents the service worker registration. You register a service worker to control one or more pages that share the same origin.
MDN
- Annotations
- @JSType() @native()
- Alphabetic
- By Inheritance
- ServiceWorkerRegistration
- EventTarget
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val active: ServiceWorker
The active property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated.
The active property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null.
MDN
- def addEventListener[T <: raw.Event](type: String, listener: Function1[T, _], options: EventListenerOptions): Unit
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
This implementation accepts a settings object of type EventListenerOptions.
MDN
- Definition Classes
- EventTarget
- def addEventListener[T <: raw.Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
MDN
- Definition Classes
- EventTarget
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def dispatchEvent(evt: raw.Event): Boolean
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().
MDN
- Definition Classes
- EventTarget
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getNotifications(options: GetNotificationOptions = ???): Promise[Sequence[Notification]]
The getNotifications() method of the ServiceWorkerRegistration interface returns a list of the notifications in the order that they were created from the current origin via the current service worker registration.
The getNotifications() method of the ServiceWorkerRegistration interface returns a list of the notifications in the order that they were created from the current origin via the current service worker registration. Origins can have many active but differently-scoped service worker registrations. Notifications created by one service worker on the same origin will not be available to other active services workers on that same origin.
MDN
- def hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val installing: ServiceWorker
The installing property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is installing.
The installing property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is installing. This property is initially set to null.
MDN
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val onupdatefound: Function1[Event, _]
The onupdatefound property of the ServiceWorkerRegistration interface is an EventListener property called whenever an event of type statechange is fired; it is fired any time the ServiceWorkerRegistration.
The onupdatefound property of the ServiceWorkerRegistration interface is an EventListener property called whenever an event of type statechange is fired; it is fired any time the ServiceWorkerRegistration. installing property acquires a new service worker.
MDN
- def propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- def removeEventListener[T <: raw.Event](type: String, listener: Function1[T, _], options: EventListenerOptions): Unit
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
This implementation accepts a settings object of type EventListenerOptions.
MDN
- Definition Classes
- EventTarget
- def removeEventListener[T <: raw.Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
MDN
- Definition Classes
- EventTarget
- val scope: String
The scope read-only property of the ServiceWorkerRegistration interface returns a unique identifier for a service worker registration.
The scope read-only property of the ServiceWorkerRegistration interface returns a unique identifier for a service worker registration. The service worker must be on the same origin as the document that registers the ServiceWorker.
MDN
- def showNotification(title: String, options: NotificationOptions = ???): Promise[Unit]
The showNotification() method of the ServiceWorkerRegistration interface creates a notification on an active service worker.
The showNotification() method of the ServiceWorkerRegistration interface creates a notification on an active service worker.
MDN
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unregister(): Promise[Boolean]
The unregister method of the ServiceWorkerRegistration interface unregisters the service worker registration and returns a Promise.
The unregister method of the ServiceWorkerRegistration interface unregisters the service worker registration and returns a Promise. The promise will resolve to false if no registration was found, otherwise it resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called ServiceWorkerContainer.register with the same scope.) The service worker will finish any ongoing operations before it is unregistered.
MDN
- def update(): Promise[Unit]
The update method of the ServiceWorkerRegistration interface allows you to ping the server for an updated service worker script.
The update method of the ServiceWorkerRegistration interface allows you to ping the server for an updated service worker script. If you don't explicitly call this, the UA will do this automatically once every 24 hours.
MDN
- def valueOf(): Any
- Definition Classes
- Object
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- val waiting: ServiceWorker
The waiting property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is installed.
The waiting property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is installed. This property is initially set to null.
MDN