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

351
Vistas
botón de retroceso del navegador deshabilitado google chrome y edge
window.history.pushState(null, null, location.href); window.addEventListener('popstate', () => { history.go(1); alert('Back button is not allowed.'); });

Mostrar el mensaje cuando se hace clic en el botón Atrás del navegador en Chrome y la última versión de Edge sobre el fragmento de código no funciona.

En Firefox funciona perfectamente.

Por favor sugiera cualquier solución.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Intente ejecutar este código y luego use el botón Atrás del navegador.

 <script> (function (global) { if (typeof global === "undefined") { throw new Error("window is undefined"); } var _hash = "!"; var noBackPlease = function () { global.location.href += "#"; // making sure we have the fruit available for juice.... // 50 milliseconds for just once do not cost much (^__^) global.setTimeout(function () { global.location.href += "!"; }, 50); }; // Earlier we had setInerval here.... global.onhashchange = function () { if (global.location.hash !== _hash) { global.location.hash = _hash; } }; global.onload = function () { noBackPlease(); // disables backspace on page except on input fields and textarea.. document.body.onkeydown = function (e) { var elm = e.target.nodeName.toLowerCase(); if (e.which === 8 && elm !== "input" && elm !== "textarea") { e.preventDefault(); } // stopping event bubbling up the DOM tree.. e.stopPropagation(); }; }; })(window); </script> <script src="http://static.jsbin.com/js/render/edit.js?4.1.8"></script> <script> jsbinShowEdit && jsbinShowEdit({ static: "http://static.jsbin.com", root: "http://jsbin.com", }); </script> <script> (function (i, s, o, g, r, a, m) { i["GoogleAnalyticsObject"] = r; (i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments); }), (i[r].l = 1 * new Date()); (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); a.async = 1; a.src = g; m.parentNode.insertBefore(a, m); })( window, document, "script", "https://www.google-analytics.com/analytics.js", "ga" ); ga("create", "UA-1656750-34", "auto"); ga("require", "linkid", "linkid.js"); ga("require", "displayfeatures"); ga("send", "pageview"); </script>

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