title: PWA - beforeinstallprompt not called
body: <p>Hello I'm trying to install a custom PWA "Add to Homescreen".</p>
  
  <p>The ServiceWorkerRegistration is successful.</p>
  
  <p>But the function beforeinstallpromp is not calling after register.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
    function request_debug(paramdata){
  
      document.getElementById('output').innerHTML += '&lt;BR&gt;'+ paramdata;
  
    }
  
    window.addEventListener('load', function() {
  
        document.getElementById('output').style.display = "block"; 
  
        if('serviceWorker' in navigator) {
  
        navigator.serviceWorker.register('sw.js').then(function(registration) {
          console.log('Service worker  registrado com sucesso:', registration);
          request_debug(registration);
  
        }).catch(function(error) {
          console.log('Falha ao Registrar o Service Worker:', error);
          request_debug(error);
  
        });
  
            var isTooSoon = true;
            window.addEventListener('beforeinstallprompt', function(e) {
  
                //e.preventDefault();
                //e.prompt();
                //promptEvent = e;
                request_debug(' window.addEventListener beforeinstallprompt fired!')
  
                if (isTooSoon) {
                  //e.preventDefault(); // Prevents prompt display
                  // Prompt later instead:
                  setTimeout(function() {
                    isTooSoon = false;
                    e.prompt(); // Throws if called more than once or default not prevented
                  }, 4000);
                }
  
            });
  
      }else{
  
        console.log('serviceWorker not in navigator');
        request_debug('serviceWorker not in navigator');
  
      }
  
  
    });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Also my service worker in root directory...
  HTTPS is secure!</p>
  
  <p>my manifest:</p>
  
  <pre><code>{
    "background_color": "purple",
    "description": "lojaportaldotricot TESTE",
    "display": "standalone",
    "icons": [
      {
        "src": "/componentes/serviceWorker/fox-icon.png",
        "sizes": "192x192",
        "type": "image/png"
      }
    ],
    "name": "lojaportaldotricot",
    "short_name": "lojaportaldotricot",
    "start_url": "/dashboard"
  }
  </code></pre>
  
  <p>It's only workes when I set "Enable" chrome://flags/#bypass-app-banner-engagement-checks</p>
  
  <hr>
  
  <p>Edit: Look's like I've found the problem. The Audits tabs of Chrome's DevTools(F12) gives debugging information.
  <a href="https://i.stack.imgur.com/oCbZE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oCbZE.png" alt="enter image description here"></a></p>