added custom alert instead of window.alert, tested on iphone, safari, ff