1

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 (but Notification.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?

John Freeman
  • 2,552
  • 1
  • 27
  • 34
  • What do you want to achieve exactly? Notify the user? or Communication between page and chrome extension? Or register a service worker via chrome extension? – Stef Chäser Jan 31 '18 at 10:22
  • I want to be able to trigger some action in the browser by sending a message over HTTP. I want the extension to listen, not to poll. – John Freeman Jan 31 '18 at 13:12
  • Since none of the behavior fits the documentation, you're probably doing something wrong and without a minimal example to reproduce the issue it is going to be hard to debug. You mention that the promise never resolves, but does it show or produce an error? – Martijn Feb 04 '18 at 09:56

0 Answers0