Skip to content

Inconsistency: Persistence of alarms in browser.alarms API #406

Description

@oliverdunk

The persistence of alarms created using the browser.alarms API is different across browsers.

MDN states the following, which appears to be true in Firefox and Safari:

Alarms do not persist across browser sessions.

In Chrome, alarms do generally persist. Due to an open bug (https://crbug.com/1285798) they can be lost if the extension is reloaded and then there is a restart before any further changes are made to the registered alarms.

My instinct is that persisting alarms across all browsers would make sense:

  • This would lead to consistent behaviour without being a breaking change for extensions in Chrome that rely on it, or extensions in other browsers which are likely recreated on each restart anyway.
  • As browsers move to non-persistent background contexts, this would allow alarms to continue being registered without developers needing to listen to runtime.onInstalled and runtime.onStartup to re-create them (not to mention the missing onEnabled event).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions