You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the canceled flag is unset, throw an InvalidStateError, optionally with the message informing the developer that .prompt() needs to be called after .preventDefault().
This text didn't make it into the final version -- I actually didn't notice it disappearing. Was it intentional?
Chrome's implementation does currently throw InvalidStateError in this case. However, on reflection, especially if #576 is actioned, it doesn't make sense to throw an error if preventDefault is not called (since the default behaviour may in fact not be to show a prompt, and therefore it's sensible to call prompt without preventDefault). In that case, this is a WontFix.
The text was updated successfully, but these errors were encountered:
mgiuca
changed the title
BeforeInstallPromptEvent: Should prompt throw InvalidStateError if preventDefault not called?
BeforeInstallPromptEvent: Should prompt() throw InvalidStateError if preventDefault not called?
May 10, 2017
We can also change Chrome -- this is straightforward since it removes an error case (shouldn't break anything).
I'd like to decide what to do with #576 first. If we allow the default behaviour to not prompt, then it doesn't make sense to have to call preventDefault before prompt.
#576 is resolved and the spec no longer requires the beforeinstallpromptevent default action to be showing an install prompt. Therefore, it is no longer sensible to require preventDefault before prompt is called (or in other words, it now makes sense to call prompt without preventDefault).
I've filed a Chrome bug crbug.com/730993 to remove this requirement. Let's close this spec bug as WontFix (Chrome will match the existing text).
A previous draft of the spec included this language in the
prompt
method:This text didn't make it into the final version -- I actually didn't notice it disappearing. Was it intentional?
Chrome's implementation does currently throw
InvalidStateError
in this case. However, on reflection, especially if #576 is actioned, it doesn't make sense to throw an error ifpreventDefault
is not called (since the default behaviour may in fact not be to show a prompt, and therefore it's sensible to callprompt
withoutpreventDefault
). In that case, this is a WontFix.The text was updated successfully, but these errors were encountered: