Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Desktop Notification with HTML Markup ( code example )?

i read this question and this is very useful for me. Chrome desktop notification example? is there any way to customize Notification via HTML markup?? and custom CSS styling for that Notification

var notification = new Notification('Notification title', {
  icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
  body: "<h2>Hey there! You've been notified!</h2>"+
        "<span>this is another element</span>",
});

UPDATE : one more thing as notification body blow show web address how can hide that web address if i want to


1 Answers

You cannot use HTML in the body of the message. But you can use unicode markup in alert body for instance (such as newline, tab and so forth).

like image 178
Lukas Valatka Avatar answered Aug 25 '26 15:08

Lukas Valatka