Re: [w3c/manifest] Feat(events): add BeforeInstallPromptEvent (#520)

kenchris commented on this pull request.



> +            This example shows how one might prevent an automated install
+            prompt from showing until the user clicks a button to install the
+            app. In this way, the site can control the installation experience.
+          </p>
+          <pre class="example"
+               title="Using beforeinstallprompt to present an install button">
+            window.addEventListener("beforeinstallprompt", async (event) =&gt; {
+              // Suppress automatic prompting.
+              event.preventDefault();
+
+              // Show the (disabled-by-default) install button. This button
+              // resolves the installButtonClicked promise when clicked.
+              installButton.disabled = false;
+
+              // Wait for the user to click the button.
+              await installButtonClicked;

I think it is a bit magic where this variable comes from

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/pull/520#pullrequestreview-33723079

Received on Thursday, 20 April 2017 09:46:24 UTC