Last active
August 29, 2015 13:59
-
-
Save bobwei/10452570 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.redirectTo = function(){ | |
// android redirect | |
if (window.navigator.userAgent.match(/Android/)){ | |
setTimeout(function() { | |
if (!document.webkitHidden){ | |
window.location = 'https://play.google.com/store/apps/details?id=com.linkwish.onepiece'; | |
} | |
}, 1000); | |
window.location = 'fb1393011827627092://'; | |
// ios redirect | |
}else if (window.navigator.userAgent.match(/iPhone|iPad|iPod/)){ | |
setTimeout(function() { | |
window.location = "https://itunes.apple.com/tw/app/ishow-ai-xiu-re-sou-hui-ju/id817350900?mt=8"; | |
}, 25); | |
window.location = 'fb1393011827627092://'; | |
} | |
}; | |
if (window.confirm('是否於 App 中查看?')){ | |
window.redirectTo(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment