Permissions: alarms

Not allowed in: Content scripts, Devtools pages

_CreateAlarmInfo
Alarm
onAlarm
clear
clearAll
create
get
getAll
onAlarm: WebExtEvent<(name: Alarm) => void>

Fired when an alarm has expired. Useful for transient background pages.

The alarm that has expired.

  • Clears the alarm with the given name.

    Parameters

    • Optionalname: string

      The name of the alarm to clear. Defaults to the empty string.

    Returns Promise<boolean>

  • Clears all alarms.

    Returns Promise<boolean>

  • Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.

    Parameters

    • alarmInfo: _CreateAlarmInfo

      Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.

    Returns void

  • Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.

    Parameters

    • name: string

      Optional name to identify this alarm. Defaults to the empty string.

    • alarmInfo: _CreateAlarmInfo

      Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.

    Returns void

  • Retrieves details about the specified alarm.

    Parameters

    • Optionalname: string

      The name of the alarm to get. Defaults to the empty string.

    Returns Promise<Alarm>

  • Gets an array of all the alarms.

    Returns Promise<Alarm[]>