jackbsteinberg / std-toast

120 stars 4 forks source link

Clarify behavior on background pages #27

Closed Manishearth closed 5 years ago

Manishearth commented 5 years ago

The document doesn't quite define what a toast is in this context, implicitly relying on the Android definition (which is a whole other issue regarding the naming, that name is Android-specific).

On Android toasts can be shown from background applications (I think, I've seen this before and some googling does show it to be possible, albeit tricky). It's unclear if this behavior is intended here too: does showing a toast from a page that is backgrounded still work? If so, the privacy/security documentation probably needs updating since this has similar issues as popups. If not, it should probably be explicitly mentioned that this UI element is wholly in-page (like <dialog>)

domenic commented 5 years ago

The intention is that it's wholly in-page; the Android API you're referencing has been largely deprecated (in favor of one named "snackbar") because it was found users do not enjoy that behavior.

This should definitely be clarified in the explainer.

domenic commented 5 years ago

On blink-dev folks noted that the mention of alert() in the README further confuses this issue. The intention there was more "developers often want to show toasts from JavaScript, so there will be a function to call", not "we will implement this like browsers used to implement alert()" (using native platform alert boxes). We need to make this clearer as well.

jackbsteinberg commented 5 years ago

Clarification added: https://github.com/jackbsteinberg/std-toast#extending-the-notification-api