ekzyis
ade35b9ea0
Add verbose logging in onPush listener ( #724 )
...
* refactor: Use log function in service worker
* Add verbose logging on push listener
* Fix TypeError: Cannot read properties of null (reading 'postMessage')
navigator.serviceWorker.controller is null on forced refreshes:
"""
This property returns null if the request is a force refresh (Shift + refresh) or if there is no active worker.
"""
-- https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/controller
This means when we unregister a service worker manually (like I do for debugging purposes) and then reload the page, there is no service worker available when this code is run.
Adding a check with a more helpful error message should improve UX.
This error might also happen in other cases where a page refresh should also help.
---------
Co-authored-by: ekzyis <ek@stacker.news>
2024-01-03 11:51:04 -06:00
..
2023-12-04 21:34:06 -06:00
2023-10-03 20:12:12 -05:00
2023-07-24 13:53:53 -05:00
2023-11-10 18:18:10 -06:00
2023-09-12 17:04:49 -05:00
2023-11-06 14:53:33 -06:00
2023-12-30 17:16:09 -06:00
2023-09-11 16:29:45 -05:00
2023-11-19 14:24:56 -06:00
2023-11-09 11:50:43 -06:00
2023-08-25 18:21:51 -05:00
2023-12-04 21:34:06 -06:00
2023-11-10 18:18:10 -06:00
2023-12-21 17:45:03 -06:00
2023-11-08 18:15:36 -06:00
2023-11-19 15:09:47 -06:00
2023-12-31 10:52:19 -06:00
2023-12-27 18:14:22 -06:00
2023-10-26 14:36:20 -05:00
2023-12-04 21:34:06 -06:00
2023-08-04 20:45:12 -05:00
2023-11-09 11:50:43 -06:00
2023-12-19 16:01:48 -06:00
2023-12-29 18:05:16 -06:00
2023-11-19 14:24:56 -06:00
2023-12-10 16:56:22 -06:00
2023-11-10 09:22:14 -06:00
2023-08-29 19:13:21 -05:00
2024-01-02 16:35:01 -06:00
2023-08-04 19:21:51 -05:00
2023-12-29 18:05:16 -06:00
2023-11-08 18:15:36 -06:00
2023-11-09 19:05:35 -06:00
2023-12-25 18:05:45 -06:00
2023-08-15 12:54:24 -05:00
2023-11-20 09:05:02 -06:00
2023-12-19 09:45:21 -06:00
2023-07-24 13:53:53 -05:00
2022-08-18 13:15:24 -05:00
2023-08-10 14:41:56 -05:00
2023-11-13 20:02:34 -06:00
2021-05-06 16:15:22 -05:00
2023-12-27 10:15:18 -06:00
2023-12-30 17:16:09 -06:00
2023-12-31 10:52:19 -06:00
2023-12-30 17:16:09 -06:00
2023-12-26 20:27:52 -06:00
2023-12-19 19:55:19 -06:00
2023-12-26 20:27:52 -06:00
2022-01-27 13:18:48 -06:00
2023-11-19 15:09:47 -06:00
2023-10-26 13:01:01 -05:00
2023-07-23 10:08:43 -05:00
2023-08-17 13:40:21 -05:00
2023-08-08 13:19:31 -05:00
2023-11-01 11:57:55 -05:00
2023-12-30 14:38:41 -06:00
2023-11-20 09:05:02 -06:00
2023-08-17 13:40:21 -05:00
2023-08-17 13:40:21 -05:00
2021-10-15 13:05:34 -05:00
2023-11-20 09:05:02 -06:00
2023-10-01 18:03:52 -05:00
2023-07-24 13:53:53 -05:00
2023-09-28 15:02:25 -05:00
2023-12-19 16:01:48 -06:00
2023-12-04 21:34:06 -06:00
2023-08-06 13:04:25 -05:00
2023-07-23 10:08:43 -05:00
2023-07-24 13:53:53 -05:00
2023-12-26 16:51:47 -06:00
2023-07-24 13:53:53 -05:00
2023-10-03 14:35:53 -05:00
2023-12-04 21:34:06 -06:00
2023-10-06 15:01:51 -05:00
2023-09-28 16:52:11 -05:00
2023-12-30 14:40:06 -06:00
2023-12-20 16:06:22 -06:00
2023-08-11 17:05:21 -05:00
2023-12-04 21:34:06 -06:00
2023-07-24 19:50:55 -05:00
2023-12-29 18:05:16 -06:00
2023-10-26 12:17:43 -05:00
2023-05-06 16:51:17 -05:00
2023-11-14 10:23:44 -06:00
2023-10-04 14:44:06 -05:00
2023-11-09 19:05:35 -06:00
2024-01-03 11:51:04 -06:00
2023-12-30 17:16:09 -06:00
2023-08-25 18:43:50 -05:00
2023-12-24 16:49:41 -06:00
2023-12-30 18:43:41 -06:00
2023-12-06 13:40:14 -06:00
2023-08-25 18:21:51 -05:00
2023-09-18 13:20:02 -05:00
2023-12-20 18:16:34 -06:00
2023-12-29 18:05:16 -06:00
2023-12-31 10:52:19 -06:00
2023-12-08 14:02:00 -06:00
2023-12-20 18:54:56 -06:00
2023-12-04 18:02:48 -06:00
2023-11-19 15:09:47 -06:00
2023-11-19 15:09:47 -06:00
2023-11-14 10:23:44 -06:00
2023-12-26 20:27:52 -06:00
2023-08-04 19:21:51 -05:00
2023-11-14 10:23:44 -06:00
2023-12-19 11:48:48 -06:00
2023-08-06 13:04:25 -05:00
2023-10-06 16:34:16 -05:00
2023-10-06 15:01:51 -05:00
2023-11-21 12:35:37 -06:00
2023-11-09 19:05:35 -06:00
2023-07-24 13:53:53 -05:00
2023-11-09 19:05:35 -06:00