Skip to content

[WebExtensions] alarms.create() argument persistAcrossSessons - #45712

Open
bershanskiy wants to merge 1 commit into
mdn:mainfrom
bershanskiy:alarms
Open

bershanskiy wants to merge 1 commit into
mdn:mainfrom
bershanskiy:alarms

Conversation

@bershanskiy

@bershanskiy bershanskiy commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Document WebExtensions alarm parameter persistAcrossSessions.

Motivation

Cool feature in Chrome and other browsers expressed interest in implementing it too.

Additional details

WECG discussion: w3c/webextensions#406
Chromium commit: chromium/chromium@900c2b0
Chromium bug: https://issues.chromium.org/issues/40815223
Chromium documentation: https://developer.chrome.com/docs/extensions/reference/api/alarms
Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1995451

Related issues and pull requests

CC @oliverdunk

@bershanskiy
bershanskiy requested a review from a team as a code owner September 14, 2026 19:03
@bershanskiy
bershanskiy requested review from willdurand and removed request for a team September 14, 2026 19:03
@github-actions github-actions Bot added Content:WebExt WebExtensions docs size/xs [PR only] 0-5 LoC changed labels Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

External URLs (1)

URL: /en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms/create
Title: alarms.create()

(comment last updated: 2026-09-29 10:30:26)

- `periodInMinutes` {{optional_inline}}
- : `double`. If this is specified, the alarm will fire again every `periodInMinutes` after its initial firing. If you specify this value you may omit both `when` and `delayInMinutes`, and the alarm will then fire initially after `periodInMinutes`. If `periodInMinutes` is not specified, the alarm will only fire once.
- `persistAcrossSessions` {{optional_inline}}
- : `boolean`. Whether alarm should persist across (profile) browsing sessions. Set this to `true` to persist alarm until the extension updates. Set to `false` to clear alarm when the extension is reloaded or updated or the browser restarts. If browser does not support profiles, then browsing session lasts from the moment the first browsing window opens until the last one closes. If browser supports profiles, then closing all windows belonging to the same (non-incognito) profile will terminate the profile browsing session, even if another profile has an active browsing session. As of September 2026, only Chrome 150+ supports this attribute, but other browsers may implement it later. In Chrome, this attribute defaults to `true` to match prior behavior. Other browsers, namely Firefox, may implement this attribute with default value of `false` to match current behavior (Firefox clears alarms across sessions). See [this discussion](https://github.com/w3c/webextensions/issues/406) for details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph is a bit heavy with technical details, but I don't think I can cut anything out. In particular, it should mention that (1) only Chromium supports this key, (2) non-persistent alarms get cleared when profile gets closed (even if a browser is open with a different profile), (3) browsers have different defaults.

@oliverdunk oliverdunk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The technical details here seem correct, but I defer to MDN folk on how to word this in a way which is understandable.

@bershanskiy

Copy link
Copy Markdown
Contributor Author

Should I do anything to advance this PR?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebExt WebExtensions docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants