I've written a web-based MUC client using strophe.js and jQuery and I'm trying to send an unavailable presence to the room and disconnect the user in the jquery unload event for the window. If a user navigates away or closes the browser tab, they should be logged out of the MUC.
I've tested the code that I'm running in this event through a logout button I have on the page, so I'm pretty sure the stanza is correct. I think strophe is having trouble sending the stanza if the browser window is closing. Is there any workaround here? I've also tried the onbeforeunload event (I know it's not entirely cross-browser compatible), but that doesn't seem to work either.
Any advice is much appreciated!
Thanks, John