【发布时间】:2018-11-30 01:27:07
【问题描述】:
(在 chrome 中,在 iOS 上)
所需的行为如下:
- 如果用户的 iOS 设备上没有该应用,该链接将在新标签页中打开
- 如果用户确实安装了相应的应用程序,则会打开它,同时不会打开 about:blank 页面
我尝试了以下方法:
window.open('link', '_blank'); // Opens app as desired but also about:blank
window.open('link'); // Opens app as desired but also about:blank
window.location = 'link'; // Opens app as desired with no about:blank page as
// desired BUT if the user doesn't have the app, it will
// open the link in the current window
【问题讨论】:
标签: javascript jquery ios google-chrome hyperlink