How do I set the start_url of a manifest.json to be the root of the site?

If you are running in the root of a site, for instance https://example.com/manifest.json or https://test.example.com/manifest.json you can use "start_url": "https://stackoverflow.com/".

However, this will also map https://example.com/test/manifest.json to https://example.com/, which fails because it’s in a folder outside the scope of the manifest.

Instead, if you are using a sub-directory you need to set both a scope and the start_url:

"start_url": "./"
"scope": "."

This will cause https://example.com/test/manifest.json to map to https://example.com/test/ as expected.

Leave a Comment