Support accurate timer in chrome.alarms api

198 views
Skip to first unread message

Jackie Han

unread,
Dec 17, 2020, 1:11:57 AM12/17/20
to Chromium Extensions
I just added a new Feature Request -  support accurate timer in chrome.alarms api.
If you also have this demand, welcome to add star.

Any Name

unread,
Jan 1, 2021, 7:00:35 AM1/1/21
to Chromium Extensions, Jackie Han
HI, I added a star.

I find it hard to believe that the GOOGLE-team is introducing such a package of solutions. It seems that this was approved by some geeks who were important in any way to eliminate some-ONE problem and don't think about anything else, since this is a strong rollback in the development of the service. It's like prohibiting money, because it is used to pay for prohibited substances.

Diego Serrano

unread,
Aug 11, 2021, 2:19:24 PM8/11/21
to Chromium Extensions, Jackie Han
Also just added a star.

I develop a productivity timer as an extension, and I just started migrating to manifest V3.
In my case users receive notifications when a timestamp in the future has been reached.

I used to have a persistent background script checking the condition. This check will now be done when the onAlarm event wakes up the service worker.

To me this is a better design, but I will definitely be losing accuracy in the following manners:
  • The time at which the alarm fires is arbitrary per the docs.
  • If the alarm needs to be reprogrammed to fire for <1 min, this will not possible and users will experience a delay.
    Maybe a setTimeout() could be used instead, but there is not guarantee the service worker will stay active.

Jackie Han

unread,
Apr 12, 2024, 6:04:42 AM4/12/24
to Diego Serrano, Chromium Extensions
To clarify this issue more clearly, I have provided the reproducible code and logs. See this link
Reply all
Reply to author
Forward
0 new messages