How to add urls and web_Urls to manifest.json file using meta tag

I am creating a progressive web application and I need to add the current URL to the manifest.json file using a meta tag.

I created this manifest. json:

{
 "name": "app",

  "icons": [{
    "src": "images/avatar.jpg",
    "sizes": "64x64"

  }, {
    "src": "images/avatar.jpg",
    "sizes": "64x64"
    }, {
    "src": "images/avatar.jpg",
    "sizes": "128x128",
    "density": 2
   }],
   "app": {
    "urls": [
           "https://www.example.com"
           ],
    "launch": {
          "web_url": "https://www.example.com"
  }
 }
  "theme_color":"#06ADD5",
  "display": "standalone",
 "orientation": "portrait"
}

the above JSON works fine in a static URL and web URL, but I want it to work as a dynamic URL (EX: www.example.com/ <PRODUCT_ID>)

+4
source share
1 answer

JSON - Manifest, Chrome Firefox - . , start_url, URL .

/path/to/manifest.json, , , , . URL, /path/to/manifest.json?start_url=*something*, - start_url JSON , - .

, , , , manifest-*something*.json , start_url, <link rel="manifest"> , URL manifest-*something*.json, , .

+2

Source: https://habr.com/ru/post/1663835/


All Articles