1

Let's say we have a web application which is available through different environments:

nightly.my-app.com
test.my-app.com
my-app.com

Using webmanifest.json we want to identify each version of our app, but we don't want to create a different webmanifest for each build. So we used these values:

"scope": "./",
"start_url": "./",
"id": "./",

My questions are:

Are these values valid? Will the browser/ device automatically resolve all values to the actual URL of the app?

lampshade
  • 2,470
  • 3
  • 36
  • 74

1 Answers1

0

When you define scope all the paths will be relative to that.

referring to developer.mozilla.org:

The scope member is a string that defines the navigation scope of this web application's application context. It restricts what web pages can be viewed while the manifest is applied. If the user navigates outside the scope, it reverts to a normal web page inside a browser tab or window.

It also says:

If the scope is a relative URL, the base URL will be the URL of the manifest.

So don't worry. this is legit and will work fine.

Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54
  • Thanks, that sounds good. This however is only about `scope`. Are the other values and especially `id` set accordingly to the value of `scope` by the device/ browser then? – lampshade Jul 13 '22 at 12:17
  • @lampshade as I know all the valid keys in `manifest.json` file are described in the link I provided in the answer and `id` is not one of them. – Mahdi Zarei Jul 13 '22 at 12:36