5

我只是在构建一个静态 HTML 页面,我想让它可以安装。

清单.json

{
    "name": "YYY",
    "short_name": "YYY",
    "icons": [
        {
            "src": "android-chrome-192x192.png",
            "sizes": "192x192",
            "type": "image/png"
        }
    ],
    "theme_color": "#ffffff",
    "background_color": "#ffffff",
    "display": "standalone",
    "start_url":"index.html"
}

索引.html

<head>
    <link rel="apple-touch-icon" sizes="180x180" href="https://xxx.png">
    <link rel="icon" type="imageits-not-the-real-one/png" href="https://xxx.png"
        sizes="32x32">
    <link rel="icon" type="imageits-not-the-real-one/png"  href="https://xxx.png"
        sizes="16x16">
    <link rel="manifest"  href="https://my-manifest-its-not-the-real-one.json">
   ..

项目结构

在此处输入图像描述

错误

清单:属性“start_url”被忽略,应该与文档的来源相同。

4

2 回答 2

8

派对迟到了,但我的网站只接受启用 HTTPS 的完整 URL

我有这个: http ://example.com/

但我不得不使用:https ://example.com/

否则我得到了

Manifest: property 'start_url' ignored error, should be same origin as document.
于 2018-04-24T03:19:22.877 回答
0

直到今天,当我在他的网络主机 (MyDomain.com) 上为一位朋友建立一个网站时,我才遇到这个问题。

在这种情况下,问题是通过改变...

"start_url": "https://[website].com/"

至...

"start_url": "https://www.[website].com/"
于 2021-02-15T20:28:17.280 回答