Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
How to detect browser back button click on a new tab ( with middle click ) in JavaScript

I want to detect when the user clicks the back button on a browser with middle click - resulting in opening in a new tab. I'm not using any libraries or frameworks other than jquery.

When the user clicks the back button ( with a left click ) he should be navigated back a page.

When the user clicks the back button ( middle click ) a new tab should be opened but should open in the same page.

I've found the following js code which 'reloads' the page but I cannot make it so that I can go back with a regular back button click

if (window.history && window.history.pushState) {
    window.history.forward();
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda