- From: Photopea <notifications@github.com>
- Date: Mon, 13 Nov 2017 09:24:27 +0000 (UTC)
- To: w3c/manifest <manifest@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 13 November 2017 09:24:50 UTC
Hi guys, do you really like this idea, that a user-agent will "analyze" a website somehow and decide, if it is appropriate to show an install prompt? It can be disturbing, if the "analysis" is wrong. I am using the following code to be able to trigger an install prompt. window.addEventListener("beforeinstallprompt", function(e){ e.preventDefault(); myEvent=e; }); if ("serviceWorker" in navigator) navigator.serviceWorker.register("sw.js", { scope: "./" }); // I call myEvent.prompt(); later, when user clicks Install The problem I have is, that if both the website and the user want the site to be installed, the user-agent itself becomes an obstacle (by not dispatching "beforeinstallprompt"). What about replacing it all with this: navigator.install(); It can throw an exception, when installing is not appropriate. If you think there is a risk of "attack" by calling it too often, we can deal with it the same way we deal with alert(...). Imagine if alert(...); worked only on Mondays and only between 12th and 37th minute of each hour. That is how I see the current draft now. -- 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/issues/627
Received on Monday, 13 November 2017 09:24:50 UTC