javascript - Logout on tab closed -


i want trigger logout when close tab of application. tried $(window).on('unload', logout); , $(window).on('onbeforeunload', logout); works fine events triggered when reload page. how can prevent on reload? before asking found options event.currenttarget.performance.navigation.type no posibility separate reload , close in way. there opputurnity trigger logout on tab closed?

as per here is there way in javascript detect if unload event caused via refresh, button, or closing browser? there no way detect difference. if there other circumstances wouldn't work.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -