Chrome apps are gone, so no chrome.sockets.tcpServer. chrome.gcm
is gone, and Firebase is way too heavy for my interests (not that I ever used chrome.gcm
). I just want to send messages from localhost; I don't want to register anything or maintain an app server. I tried the Push API with Service Workers, but ran into problems.
What works:
- I can register a service worker. The registration eventually enters the active state.
What doesn't work:
- The
navigator.serviceWorker.ready
promise never resolves. Notification.requestPermission
does nothing (butNotification.permission === 'granted'
if I add the notification permission to the extension manifest).- The
registration.pushManager.subscribe
promise never resolves. registration.pushManager.permissionState
resolves to'prompt'
, but no prompt ever appears.
None of this behavior fits the documentation I linked. How can I solve this problem?