Discussion:
[chromium-discuss] Long-running or scheduled service worker?
Glen Little
2018-11-25 16:23:22 UTC
Permalink
I have a web page that has a manifest and service worker. At the user's
request, it displays a notification on the device. This is working well
and the notification remains indefinitely even after leaving or closing the
web page.

However, the notification is time-sensitive and should be updated twice a
day.

Is there any way to do this when the webpage is no longer in focus or
loaded?

I've tried using setTimeout in the service worker, but that does not work
when the service worker is unloaded. I've had the client call to a
dedicated server, requesting a call-back at the desired time. But this has
not worked well either and requires that the client be online at that time.

What I would like is simply a way to schedule a wake-up at a certain time
so that a new notification can be generated to replace the previous one.
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
d***@chromium.org
2018-11-27 23:29:29 UTC
Permalink
Hi Glen,

The ability to run scheduled tasks is something we're looking to implement
- follow https://crbug.com/891339 for more details.
Post by Glen Little
I have a web page that has a manifest and service worker. At the user's
request, it displays a notification on the device. This is working well
and the notification remains indefinitely even after leaving or closing the
web page.
However, the notification is time-sensitive and should be updated twice a
day.
Is there any way to do this when the webpage is no longer in focus or
loaded?
I've tried using setTimeout in the service worker, but that does not work
when the service worker is unloaded. I've had the client call to a
dedicated server, requesting a call-back at the desired time. But this has
not worked well either and requires that the client be online at that time.
What I would like is simply a way to schedule a wake-up at a certain time
so that a new notification can be generated to replace the previous one.
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Glen Little
2018-11-27 23:34:48 UTC
Permalink
This would be wonderful!!
Post by d***@chromium.org
Hi Glen,
The ability to run scheduled tasks is something we're looking to implement
- follow https://crbug.com/891339 for more details.
Post by Glen Little
I have a web page that has a manifest and service worker. At the user's
request, it displays a notification on the device. This is working well
and the notification remains indefinitely even after leaving or closing the
web page.
However, the notification is time-sensitive and should be updated twice a
day.
Is there any way to do this when the webpage is no longer in focus or
loaded?
I've tried using setTimeout in the service worker, but that does not work
when the service worker is unloaded. I've had the client call to a
dedicated server, requesting a call-back at the desired time. But this has
not worked well either and requires that the client be online at that time.
What I would like is simply a way to schedule a wake-up at a certain time
so that a new notification can be generated to replace the previous one.
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...