The TaskController()
constructor creates a new TaskController
object, optionally setting the initial priority of its associated signal
.
If no priority is set, the signal priority defaults to user-visible
The TaskController()
constructor creates a new TaskController
object, optionally setting the initial priority of its associated signal
.
If no priority is set, the signal priority defaults to user-visible
js
new TaskController()
new TaskController(options)
This code shows how to construct a task controller that has a signal with default priority (user-visible
).
js
const controller = new TaskController();
To construct a task controller that has a specific signal priority, pass the priority
as a property of the optional argument.
js
controller2 = new TaskController({ priority: "user-blocking" });
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
TaskController |
94 | 94 | 101 | No | 80 | No | 94 | 94 | No | 66 | No | 17.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/TaskController/TaskController