javascript - 如何使 web 应用程序在 web 应用程序中打开链接而不是 safari

标签 javascript html web-applications mobile-safari

所以我正在 iFraming 另一个网站,我希望我的用户将该网站添加到主屏幕并从那里使用它。但是当我尝试使用其他网站的代码时,它不起作用。

最佳答案

将这些元标记包含在 <head> 中您的index.html文件。在 iOS 上,这将模拟一个可以添加到主屏幕的 Web 应用程序。

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="AppTitle">

<link rel="apple-touch-icon" href="/custom_icon.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="180x180" href="touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="167x167" href="touch-icon-ipad-retina.png">

<link rel="apple-touch-startup-image" href="/launch.png">

为了让每个设备正确加载图标和启动图像,您的图像必须具有下面链接的 Apple UI 指南中描述的精确尺寸。如果图像未指定这些尺寸,则不会加载。

Launch Screen Dimensions

App Icon Dimensions

Configuring Web Applications

此要点还显示所有可用的元标记:https://gist.github.com/tfausak/2222823

关于javascript - 如何使 web 应用程序在 web 应用程序中打开链接而不是 safari,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41202724/

相关文章:

javascript - 为什么选择菜单需要 window.location?

javascript - jQuery UI 自动完成 : Complete what I've typed after blur but before ajax request completes?

java - PreparedStatement 和 Oracle 10g 错误

java - 如何在 Java 中创建 session ?

javascript - 将连续的 ","合并为单个 ","并在一个 RegExp 中删除前导和尾随 ","

javascript 正确四舍五入到两位小数,不可能吗?

html - 如何在桌面 View 中左对齐图像并在移动 View 中将其居中?

HTML head 标签顺序错误

html - 登录应用程序 - 单击提交按钮重定向到另一个页面

python - 推荐用于本地网络应用程序的 python 库/框架?