ExtendableEvent extension type

The ExtendableEvent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.

If ExtendableEvent.waitUntil is called outside of the ExtendableEvent handler, the browser should throw an InvalidStateError; note also that multiple calls will stack up, and the resulting promises will be added to the list of extend lifetime promises.

This interface inherits from the Event interface.

Note: This interface is only available when the global scope is a ServiceWorkerGlobalScope. It is not available when it is a Window, or the scope of another kind of worker.

on
Implemented types
Implementers

Constructors

ExtendableEvent(String type, [ExtendableEventInit eventInitDict])
factory

Properties

bubbles bool
no setterinherited
cancelable bool
no setterinherited
cancelBubble bool
getter/setter pairinherited
composed bool
no setterinherited
currentTarget EventTarget?
no setterinherited
defaultPrevented bool
no setterinherited
eventPhase int
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isTrusted bool
no setterinherited
returnValue bool
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
srcElement EventTarget?
no setterinherited
target EventTarget?
no setterinherited
timeStamp DOMHighResTimeStamp
no setterinherited
type String
no setterinherited

Methods

composedPath() JSArray<EventTarget>
The composedPath() method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.
inherited
initEvent(String type, [bool bubbles, bool cancelable]) → void
The Event.initEvent() method is used to initialize the value of an event created using Document.createEvent.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preventDefault() → void
The preventDefault() method of the Event interface tells the that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
inherited
stopImmediatePropagation() → void
The stopImmediatePropagation() method of the Event interface prevents other listeners of the same event from being called.
inherited
stopPropagation() → void
The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the Event.preventDefault method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see Event.stopImmediatePropagation.
inherited
toString() String
A string representation of this object.
inherited
waitUntil(JSPromise<JSAny?> f) → void
The ExtendableEvent.waitUntil() method tells the event dispatcher that work is ongoing. It can also be used to detect whether that work was successful. In service workers, waitUntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.

Operators

operator ==(Object other) bool
The equality operator.
inherited