Beforeunload for PWA

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Beforeunload for PWA

Adam Eisenreich
I think that PWA should have the ability to override the default beforeunloadEvent message.

Since returning string is already deprecated and removed from all browsers, it would be safe to change how the returned value is handeled.

All proposed changes should only apply to installed PWAs!

If the return value is:
  1. HTMLFormElement - display the element in front of everything with a backdrop disabling every other interaction.
    * CSS of the page should apply to this element.
    * Browser listens to the "submit" event of the form; 
    based on the truthiness of the return value from the form submit event either close window or hide message while keeping window open
    * Closing the window via system buttons a second time (while dialog is open) will force the closing of the page.
  2. String - Display the standard beforeunload dialog that used to have the custom message.
What are your thoughts? Should PWA have the exception and have elevated possibilities?

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Beforeunload for PWA

Jordan Harband
PWAs and events aren't part of the JS language; see https://html.spec.whatwg.org

On Tue, Mar 30, 2021 at 5:39 AM Adam Eisenreich <[hidden email]> wrote:
I think that PWA should have the ability to override the default beforeunloadEvent message.

Since returning string is already deprecated and removed from all browsers, it would be safe to change how the returned value is handeled.

All proposed changes should only apply to installed PWAs!

If the return value is:
  1. HTMLFormElement - display the element in front of everything with a backdrop disabling every other interaction.
    * CSS of the page should apply to this element.
    * Browser listens to the "submit" event of the form; 
    based on the truthiness of the return value from the form submit event either close window or hide message while keeping window open
    * Closing the window via system buttons a second time (while dialog is open) will force the closing of the page.
  2. String - Display the standard beforeunload dialog that used to have the custom message.
What are your thoughts? Should PWA have the exception and have elevated possibilities?
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss