You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/08/01 08:12:17 UTC

[GitHub] wvengen edited a comment on issue #276: CB-14188: add beforeload event, catching navigation before it happens

wvengen edited a comment on issue #276: CB-14188: add beforeload event, catching navigation before it happens
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/276#issuecomment-409489649
 
 
   Reading up on HTML's `beforeunload` event, I do see `preventDefault()`, e.g. on [MDN](https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload), [W3C HTML 5.0](https://www.w3.org/TR/html50/browsers.html#unloading-documents) (suggesting `e.returnValue`) and [WHATWG](https://html.spec.whatwg.org/#prompt-to-unload-a-document) (preferring `e.preventDefault()`).
   
   I would suggest to adopt `e.returnValue` and `e.preventDefault()` in InAppBrowser's new `beforeunload` event. This is in-line with current standards, allows using the existing event handling infrastructure, and by updating the event this will also work with multiple event handlers. It does require some changes to the event object passed on to the handlers (so that returnValue can be reported back, and `e.preventDefault()` is available).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org