Pregunta

So...I am fighting with the IOS stand alone web app mode.

Basically, there is no way to throw a popup via javascript, so the Facebook Like plugins and Google Ads navigate in the same stand alone window.

Without browser navigation controls, there is absolutely no way back to your page.

So..I found a post on SO indicating you can dynamically create a link, and then fire the click event on the link, thus triggering a new window.

This works because the IOS stand alone web-app-enabled mode will only open a new window for anchor tags, not javascript window.open.

So, I'd like to know if there is any way I can intercept/detect/hook the browser trying to issue a window.open. Odds are it won't fire in the stand alone mode anyway, but it's worth a shot.

¿Fue útil?

Solución

If i get it:

window.oOpen = window.open;
window.open = function () {
    alert("window.open called");
    window.oOpen.apply(this, arguments);
};
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top