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

105
Visualizações
Message for Browser Tab

I want to add a message for example: If the user leaves the browser tab, the message "Looks like you're gone ..." should appear. When the user returns to the page, change the message to "Good to be back".

Is it possible to do something like this?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Crate an eventListener on your window, with the load event, and simply show an alert.

And create an event on your window called onbeforeunload (more info about the event), where you show an alert while leaving the page.

Note: onbeforeunload won't work in this snippet, but try putting inside your code.

window.addEventListener('load', (event) =>{

    alert("Looks like you are back");

});

window.onbeforeunload = function() {
          alert("Looks like you want to leave");
      };

about 4 years ago · Juan Pablo Isaza Relatório

0

You can achieve this with the Page Visibility API

Answered here

about 4 years ago · Juan Pablo Isaza Relatório
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