My goal is to send Gmail-style desktop notifications in Chrome or Firefox from a web app (let's call it X) that is NOT currently open in the browser, without requiring the user to install an app or extension. It's okay if the user needs to grant permission to receive notifications from X, and it's okay if the browser needs to be open for the notification to appear, as long as X doesn't need to be open in the browser. A solution that doesn't require any browser window to be open would also work.
I just spent the day digging into this, and so far I think I've learned:
- Since OSX Mavericks, it has been possible to do this in Safari 7+ via Safari Push Notifications.
- The Web Notifications API works in Chrome/Firefox, but requires the user's browser to be open to X.
- Twitter sends similar web notifications without asking the user for permission first, but requires the user's browser to be open to Twitter.
- There are lots of references to possible Growl implementations, but as far as I can tell, all of them require the user to install Growl and/or a Growl-enabled app to work.
I could be wrong about any of my statements above - I'd love to hear it! - and I'm open to any other solution too. Any ideas?
Thanks for reading.
You can send push notifications even when your web page is not active using Service Workers, the Notification API for service workers and the push API for server-initiated notifications (or scheduled notifications).
As of June 2016, Service Workers are supported in Chrome, Firefox and Opera. See the status at https://jakearchibald.github.io/isserviceworkerready/
See the following links for related discussions, status of implementation and specifications.
You can do exactly what you are looking for using the W3C Push API.
If you want to build everything from scratch I suggest to start reading this tutorial by Google. It is for Chrome, but Firefox works in a very similar way.
However it's a lot of work and the "standard" is still evolving: I suggest that you use a service like Pushpad (I am the founder).
You asked this to us over at Growl at our support address as well. I'll answer with as much as I know how. However what you want is essentially desktop push notifications. Even on iOS you need to have an application installed in order to have push notifications for that application.
The bottom line is that what you are wanting seems to be pretty much a wild goose chase. You want no app and no browser tab, but you want to be able to invade the user's personal space randomly. This just doesn't seem right. At least with Growl the person using the computer can shut you down if they find your notifications annoying. The same is true with Notification Center (NC) in more current OS X installations.
Firefox has their own notifications now. I don't know how they work since I stopped using Firefox on OS X when they did this. Chrome has notifications as well. But as far as I can tell you need the tab open there, so I'm guessing that's what FF did as well.
Essentially speaking as a user I really think this is an awful experience. You have a web app, it should be a web app. It's not a desktop app. I'm not saying it's good or bad for a web app to be a web app, but essentially you're wanting to push down upon a user without implicit permission which just doesn't seem exactly right to me.
I don't know of any way to send a notification with at least some kind of application running to do it. Be it Growl or the NC daemon or whatever else. Essentially speaking I don't think what you want to do is possible. I'd be happy to be wrong of course, but I don't think I am here. Sorry about that.
That said you could have a small application with Growl support in it via the current framework. If the end user doesn't have Growl installed, it'll opt to use NC to display. If it's an older OS it'll use Mist, which you mentioned in the email to our support team.
I hope this helps, or at least gets you what you need to keep moving forward. :)