This code is working in most android/chrome mobile browsers:
document.body.addEventListener('touchend', function (e) {
//alert(1);
window.open("http://test.com");
}, false)
But it is not working in iOS/Safari (tested with iPhone OS 9_2, AppleWebKit 601.1.46, Safari/601.1).
Is there any workaround to show a new window/tab with this event?
"alert(1)" is working fine, so i suppose the event is firing normally.
Thank you.
It seems that since iOS >= 9.0, you can no longer use window.open inside a "touchstart" event handler function. You can use the click instead.
I iOS 8.x you can still open a page with window.open in a "touchstart" event handler function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With