Documentation/EventTarget
classWORKER

EventTarget

js/worker.js:787
EventTarget()

Base event target used by Worker objects, Worker global scopes and BroadcastChannel objects.

methodWORKER

addEventListener

js/worker.js:794
addEventListener(type, callback, options)

Registers an event listener.

Parameters

NameTypeDescription
typestring
callback(function|Object)

Function or object with a handleEvent() method.

optionsoptional(boolean|Object)
methodWORKER

dispatchEvent

js/worker.js:812
dispatchEvent(event)

Dispatches an event to registered listeners.

Parameters

NameTypeDescription
eventEvent

Returns

boolean —

false when a cancelable event was canceled, otherwise true.

methodWORKER

removeEventListener

js/worker.js:803
removeEventListener(type, callback, options)

Removes a matching event listener.

Parameters

NameTypeDescription
typestring
callback(function|Object)
optionsoptional(boolean|Object)