Domanda

I'm interested in using the html5 notifications api but have a few questions:

  1. Is it possible to customize the notification background? By default it's white but I'd like to use black with a little transparency.
  2. Is it possible to make the notification clickable? Or at least click back to the app in the Chrome browser? Or are notifications purposely not clickable?

Thanks

È stato utile?

Soluzione

There are two types of notifications:

  1. webkitNotifications.createNotification - this will create a generic notification that can be passed exactly three items: Title, Icon, Content
  2. webkitNotifications.createHTMLNotification - this can be passed a url to an html page that will be displayed a notification

If you want more control than createNotification offers, use createHTMLNotification and pass it a custom html page.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top