Notification JS, can it be customized?


I have followed these steps to make a notification on my website:



And this is what I have:

$(document).ready(function() {
    theBody = "" +
            "<div style='background: #0055a0; color: #ffffff'>" +
            "   <strong>Tienes nuevos pedidos!</strong>"+
    theTitle = "<h1>Hay un nuevo pedido</h1>";
    var options = {
        body: theBody,
    var n = new Notification(theTitle,options);
    setTimeout(n.close.bind(n), 15000);

And it works, but it shows me the content as plain text, is there any way to customize the colors the background color and the letter?

asked by Pavlo B. 09.08.2018 в 17:43

1 answer


You can add an image by adding


staying like this:

   Notification.requestPermission(function (status) {
        // Si el usuario acepta
        if (status === "granted") {
         var title = 'My Notification';
    var options = {
       icon: '',
       body: 'nueva notificación'
  var n = new Notification(title,options);
    setTimeout(n.close.bind(n), 1000);


But these notifications do not allow much more customization since the browser, Chrome, Mozilla, Edge are the ones that give you your own personalization

answered by 09.08.2018 / 18:53