- From: Marcos Cáceres <notifications@github.com>
 - Date: Thu, 27 Oct 2016 23:39:33 -0700
 - To: w3c/manifest <manifest@noreply.github.com>
 
Received on Friday, 28 October 2016 06:40:04 UTC
@dominickng, @mgiuca, @mounirlamouri , I'm still a little bit confused by this part of the spec: 
```js
      if (this.defaultPrevented === false) {
        const msg = ".prompt() needs to be called after .preventDefault()";
        throw new DOMException(msg, "InvalidStateError");
      }
```
Because, you can immediately do:
```js
ev.preventDefault();
ev.prompt().then(...);
```
Why don't we just treat such .prompt() calls as normal? So:
```js
addEventListener("beforeinstallprompt", async function(ev) {
   const { userChoice } = await ev.prompt();
   console.log("user chose:", userChoice); 
} );
```
I'm probably missing something... but that would be nicer than throwing so many errors.  
-- 
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/417#issuecomment-256847597
Received on Friday, 28 October 2016 06:40:04 UTC