Melchia
Melchia

Reputation: 24224

Manifest: property 'start_url' ignored, should be same origin as document

I was just building a static HTML page & I wanted to make it installable.

manifest.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"
}

index.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">
   ..

Project structure

enter image description here

Error

Manifest: property 'start_url' ignored, should be same origin as document.

Upvotes: 9

Views: 26474

Answers (3)

Fred Lackey
Fred Lackey

Reputation: 2391

Seeing this means your site is serving a manifest file with a URL that does not match what your browser is using to connect. The path to this file is specified in the <head></head> of your pages:

<html lang="en">
  <head>
    <link rel="manifest" href="/icons/site.webmanifest" />
  </head>
  <body></body>
</html>

Using the path from your .html pages, locate the file, open it, and change the start_url property to the base URL that you are using to connect from your browser to the site. In the example below, this is pointing to localhost:3000:

{
  "name": "My Cool Site",
  "short_name": "coolsite",
  "icons": [
    {
      "src": "/icons/android-chrome-96x96.png",
      "sizes": "96x96",
      "type": "image/png"
    }
  ],
  "theme_color": "#ffffff",
  "background_color": "#ffffff",
  "start_url": "http://localhost:3000",
  "display": "standalone"
}

Of course, this URL is environment specific. More than likely this will be different for you when developing locally compared to when you launch the site publicly.

Upvotes: 0

Alan M.
Alan M.

Reputation: 1369

I had not faced this issue until today when I set up a website for a friend on his web host (MyDomain.com).

In this case, the problem was solved by changing...

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

to...

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

Upvotes: 3

brandito
brandito

Reputation: 708

Bit late to the party but my site will ONLY accept the full URL with HTTPS enabled

I had this: http://example.com/

but I had to use: https://example.com/

otherwise I was getting the

Manifest: property 'start_url' ignored error, should be same origin as document.

Upvotes: 10

Related Questions