Open fallaciousreasoning opened 5 years ago
I think you're probably right. Maybe we don't need preventDefault.
Recently, it was raised that it may be difficult to determine which handler has called focus/open/showNotification
, so if we continue down this avenue we may need the call to preventDefault
after all.
My intuition here is that it should, as otherwise we open the path for strange behavior (I called client.focus() but the browser still opened a new window!).
This raises the question of whether
preventDefault
even needs to be part of the spec, as the event already MUST focus a client or show a notification in order to prevent default behavior. This means that a call to preventDefault is either: a) Superfluous, we already know the app intends to preventDefault, they called client.focus() or displayed a notification or b) A no-op, the app calledpreventDefault
but they didn't focus a client/show a notification, so the browser does whatever it normally does.For example, compare (explicit preventDefault):
and (with preventDefault implicit)
@raymeskhoury