TaskPriorityChangeEvent: TaskPriorityChangeEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is available in Web Workers.

The TaskPriorityChangeEvent() constructor creates a new TaskPriorityChangeEvent object.

This object is created with a value indicating the previous priority of the task: the priority before it changed and this event was fired.

Syntax

js
new TaskPriorityChangeEvent(type, options)

Parameters

type

A string with the case-sensitive name of the associated event. User agents set it to "prioritychange".

options

An object that, in addition of the properties defined in Event(), can have the following properties:

previousPriority

A string indicating the previous priority of the task. One of: "user-blocking", "user-visible", "background".

Specifications

Specification
Prioritized Task Scheduling
# dom-taskprioritychangeevent-taskprioritychangeevent

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
TaskPriorityChangeEvent() constructor