Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. TaskController
  4. TaskController()

TaskController: TaskController() 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 inWeb Workers.

TheTaskController() constructor creates a newTaskController object, optionally setting the initialpriority of its associatedsignal.

If no priority is set, the signal priority defaults touser-visible

Syntax

js
new TaskController()new TaskController(options)

Parameters

optionsOptional

An object with the following properties:

priorityOptional

Thepriority of the signal associated with thisTaskController.One of:"user-blocking","user-visible" (default),"background".

Examples

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 thepriority as a property of the optional argument.

js
controller2 = new TaskController({ priority: "user-blocking" });

Specifications

Specification
Prioritized Task Scheduling
# dom-taskcontroller-taskcontroller

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp