javascript - How to use JS detect user close page on Safari -


i want detect user close page using js, in chrome/firefox use onbeforeunload event, in safari (on macos , ios) doesn't work (but mdn work...)

in safari on macos, onbeforeunload work first time refresh/close page.

i try unload, beforeunload, pagehide not work.

please try following.

window.unload = function ()  {  // add code here  }; 

here documentation https://www.w3.org/tr/dom-level-2-events/events.html


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -