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

63
Vistas
JavaScript triggered redirect not working on site opened in facebook webview

Opening our ecommerce site from within the Facebook app on Android, opens the page itself in a Facebook web view. When performing the purchase, an external app is opened for digital identification, and the user then has to return to the Facebook web view. Upon returning to Facebook - the user should be redirected to a thank you page.

This works fine in iOS. However - in some Android phones this doesn't work. The hypothesis is that the Facebook web view blocks programmatically initiated redirects, since putting the url in a link clicked by the user works fine.

The issue is recreated in Pixel with Android 12 and Facebook app, however the redirect works in some other web view apps on the same phone making Facebook app a suspect.

Different redirect approaches that has been tested with and without delays:

//1
document.location = url;

//2
window.location.replace(url);

//3
window.location.href = url;

//4
window.top.location.replace(url);

//5
window.location.replace(url);
window.location.reload();

//6
window.top.location.href = url;
window.open(url);

//7
if (!!(window.history && history.replaceState)) {
    window.history.replaceState(
        {},
        "a title",
        url
    );
}

//8
document.location = url;
document.location.reload()

None of them seems to work. Are there any other suggestions on how to solve this? Much appreciated!

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