title: How to create PWA manifest.json dynamic?
body: <p>I have created a functionality using static variablevariables in manifest.json such as :</p>
  
  <pre>
   -- name
   -- short_name
   -- start_url
  </pre>
  
  <p>And it's working fine for the "Add To Home Screen".
  When I set manifest.json variable dynamically, the add to screen does not work</p>
  
  <p>Basically I have an e-commerce PWA. My requirement is the following: if a user visits the app url (ex: www.example.com/products/PRODUCT_NAME_A ), he should be able to create a shortcut link on home screen or many  they want based on different URLs.</p>
  
  <p>You can also check my code that I  have done so far in javascript:</p>
  
  <pre><code>
  
  var domain = document.location.origin;
  var currentUrl = window. location. href;
  
  var myDynamicManifest = {
      "name": "My App",
      "short_name": "My App",
      "description": "This is my App",
      "start_url": currentUrl,
      "scope": ".",
      "background_color": "#5F6EDD",
      "theme_color": "#efbc4b",
      "orientation": "portrait",
      "display": "standalone",
      "lang": "en",
      "dir": "ltr",
      "icons": [
          {
            "src"     : domain + "/images/logo/logo_70x70.png",
            "sizes"   : "70x70",
            "type"    : "image/png"
          },
          {
            "src"     : domain + "/images/logo/logo_120x120.png",
            "sizes"   : "120x120",
            "type"    : "image/png"
          },
          {
            "src"     : domain + "/images/logo/logo_144x144.png",
            "sizes"   : "144x144",
            "type"    : "image/png"
          },
  
      ]
      }
  
  const stringManifest = JSON.stringify(myDynamicManifest);
  
  const blob = new Blob([stringManifest], {type: 'application/javascript'});
  
  const manifestURL = URL.createObjectURL(blob);
  
  document.querySelector('#manifest').setAttribute('href', manifestURL);
  </code></pre>
  
  <p>I expected the output being like: <a href="http://prntscr.com/oej48u" rel="noreferrer">http://prntscr.com/oej48u</a></p>