The SharedWorker constructor creates a SharedWorker object that executes the script at the specified URL.This script must obey the same-origin policy.
The SharedWorker constructor creates a SharedWorker object that executes the script at the specified URL.This script must obey the same-origin policy. If the URL has an invalid syntax or if the same-origin policy is violated, a DOMException of type SECURITY_ERR is thrown.
A DOMString representing the URL of the script the worker will execute. It must obey the same-origin policy.
An optional argument that specifies an existing SharedWorkerGlobalScope.name — if this is specified then that SharedWorkerGlobalScope will be used as the scope for this shared worker.
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
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
The AbstractWorker.onerror property represents an EventHandler, that is a function to be called when the error event occurs and bubbles through the Worker.
The AbstractWorker.onerror property represents an EventHandler, that is a function to be called when the error event occurs and bubbles through the Worker.
MDN
The port property of the SharedWorker interface returns a MessagePort object used to communicate and control the shared worker.
The port property of the SharedWorker interface returns a MessagePort object used to communicate and control the shared worker.
MDN
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
MDN
The SharedWorker interface represents a specific kind of worker that can be accessed from several browsing contexts, such as several windows, iframes or even workers. They implement an interface different than dedicated workers and have a different global scope, SharedWorkerGlobalScope.
MDN