【问题标题】:How do I make a webapp open link inside the webapp instead of safari如何在 webapp 而不是 safari 中创建 webapp 打开链接
【发布时间】:2016-12-17 20:27:32
【问题描述】:

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

【问题讨论】:

    标签: javascript html web-applications mobile-safari


    【解决方案1】:

    在您的index.html 文件的<head> 中包含这些元标记。在 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 用户界面指南中描述的确切尺寸。如果图像未指定这些尺寸,则不会加载。

    Launch Screen Dimensions

    App Icon Dimensions

    Configuring Web Applications

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

    【讨论】:

    • 这不是我要问的,因为我可以让第一页成为 web 应用程序,但是当我点击 iframed web 应用程序上的链接时,它会将其加载到 safari
    猜你喜欢
    • 2012-02-11
    • 2011-06-01
    • 2020-04-22
    • 1970-01-01
    • 2015-11-25
    • 1970-01-01
    • 1970-01-01
    • 2013-09-23
    • 1970-01-01
    相关资源
    最近更新 更多