Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

209
Visualizações
I'm trying to work with notifications but I'm getting a text that contains my localhost wrapped in <a> element and I don't know where it's coming from

I have the following function which creates a notification:

displayNotification(title: string, msg: string, avatarUrl: string, room: Room) {
    const notifBody = {
        body: msg,
    };
    if (avatarUrl) notifBody['icon'] = avatarUrl;
    const notification = new window.Notification(title, notifBody);

    notification.onclick = function() {
        dis.dispatch({
            action: 'view_room',
            room_id: room.roomId,
        });
        window.focus();
        notification.close();
    };

    return notification;
}

As you can see, when I'm creating the notification I pass a title and body to it. The title contains Bozhidar3 and the body contains Test Message so I expect the notification to only have these 2 fields alongside an icon. What actually happens is that I see this:

enter image description here

I can see my localhost wrapped around <a></a> tag and I have no idea where is it coming from. I went through all the notification instance properties here - https://developer.mozilla.org/en-US/docs/Web/API/notification but I couldn't figure out what might this be. Does anyone have an educated guess where this might be coming from?I'm using Chrome on Linux.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda