HTML5 notification with HTML elements inside

How to insert HTML tags inside the header and body of HTML5 notifications?

+7
html5-notifications
source share
1 answer

You can easily embed HTML in both the header and body:

var notification = new Notification('<title>title</title>',{body:'<b>bold</b> content'}); 

But it makes no sense: it will not render. In Firefox, it will look like this:

desktop notification with visible HTML

spec says that each of them is just a DOMString , which means plain text.

If you only care about Chrome support, you can take a look at Rich Notifications . Otherwise, it seems that we need to wait until some means for creating notifications on the desktop appear.

+2
source share

All Articles