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 is the interface for the prioritychange event.
TaskPriorityChangeEvent()Creates a new TaskPriorityChangeEvent object, setting an event name and previous priority.
This interface also inherits the properties of its parent, Event.
TaskPriorityChangeEvent.previousPriority Read only
Returns the priority of the corresponding TaskSignal before this prioritychange event.
This interface has no methods of its own, but inherits the methods of its parent, Event.
An object of this type is returned in the handler for a prioritychange event. The code below shows a handler in which the newPriority and previousPriority are logged.
// Listen for 'prioritychange' events on the controller's signal.
controller.signal.addEventListener("prioritychange", (event) => {
const previousPriority = event.previousPriority;
const newPriority = event.target.priority;
console.log(`Priority changed from ${previousPriority} to ${newPriority}.`);
});
A more complete live example can be found in prioritychange event > Examples.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
TaskPriorityChangeEvent |
94 | 94 | 142 | 80 | No | 94 | 142 | 66 | No | 17.0 | 94 | No |
TaskPriorityChangeEvent |
94 | 94 | 142 | 80 | No | 94 | 142 | 66 | No | 17.0 | 94 | No |
previousPriority |
94 | 94 | 142 | 80 | No | 94 | 142 | 66 | No | 17.0 | 94 | No |
prioritychange event
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/TaskPriorityChangeEvent