Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

alarms

Schedule code to run at a specific time in the future. This is likeWindow.setTimeout() andWindow.setInterval(), except that those functions don't work with background pages that are loaded on demand.

Alarms do not persist across browser sessions. They are created globally across all contexts of a single extension. E.g. alarm created in background script will fireonAlarm event in background script, options page, popup page and extension tabs (and vice versa). Alarms API is not available inContent scripts.

To use this API you need to have the "alarms"permission.

Types

alarms.Alarm

Information about a particular alarm.

Methods

alarms.clear()

Clear a specific alarm, given its name.

alarms.clearAll()

Clear all scheduled alarms.

alarms.create()

Create a new alarm.

alarms.get()

Retrieves a specific alarm, given its name.

alarms.getAll()

Retrieve all scheduled alarms.

Events

alarms.onAlarm

Fired when an alarm goes off.

Example extensions

Browser compatibility

Note:This API is based on Chromium'schrome.alarms API.

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp