The SharedWorkerGlobalScope object (the SharedWorker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See the complete list of functions available to workers.
The name that the SharedWorker was (optionally) given when it was created using the SharedWorker() constructor. This is mainly useful for debugging purposes.
Instance properties inherited from WorkerGlobalScope
Returns the CacheStorage object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
Returns the WorkerLocation associated with the worker. WorkerLocation is a specific location object, mostly a subset of the Location for browsing scopes, but adapted to workers.
Returns the WorkerNavigator associated with the worker. WorkerNavigator is a specific navigator object, mostly a subset of the Navigator for browsing scopes, but adapted to workers.
Returns the Performance object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available.
Imports one or more scripts into the worker's scope. You can specify as many as you'd like, separated by commas. For example: importScripts('foo.js', 'bar.js');