class WorkerGlobalScope
package js.html
extends EventTarget
extended by DedicatedWorkerGlobalScope, ServiceWorkerGlobalScope, SharedWorkerGlobalScope
Available on HTML5
The WorkerGlobalScope
interface of the Web Workers API is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window
objects — in this case event handlers, the console or the associated WorkerNavigator
object. Each WorkerGlobalScope
has its own event loop.
Documentation WorkerGlobalScope by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See:
Variables
read onlylocation:WorkerLocation
Returns the WorkerLocation
associated with the worker. It is a specific location object, mostly a subset of the Location
for browsing scopes, but adapted to workers.
read onlynavigator:WorkerNavigator
Returns the WorkerNavigator
associated with the worker. It is a specific navigator object, mostly a subset of the Navigator
for browsing scopes, but adapted to workers.
read onlyperformance:Performance
Returns the Performance
associated with the worker. It is a regular performance object, except that only a subset of its property and methods are available to workers.
read onlyself:WorkerGlobalScope
Returns a reference to the WorkerGlobalScope
itself. Most of the time it is a specific scope like DedicatedWorkerGlobalScope
, SharedWorkerGlobalScope
or ServiceWorkerGlobalScope
.
Methods
createImageBitmap (aImage:EitherType<ImageElement, EitherType<VideoElement, EitherType<CanvasElement, EitherType<Blob, EitherType<ImageData, EitherType<CanvasRenderingContext2D, ImageBitmap>>>>>>, aSx:Int, aSy:Int, aSw:Int, aSh:Int):Promise<ImageBitmap>
createImageBitmap (aImage:EitherType<ImageElement, EitherType<VideoElement, EitherType<CanvasElement, EitherType<Blob, EitherType<ImageData, EitherType<CanvasRenderingContext2D, ImageBitmap>>>>>>):Promise<ImageBitmap>
Throws:
null | DOMError |
---|
Allows you to write a message to stdout — i.e. in your terminal. This is the same as Firefox's window.dump
, but for workers.