javascript - send out XMLHttpRequest on closing firefox -


i have problem. send out xml http request (xhr) firefox extension server know when firefox has been closed.

now problems found these:

onunload: the xmlhttprequest aborted when firefox closed, preventing receiving request

onbeforeunload: seems initiated when firefox restarted, , not closed!

onclose: same problem onunload.

so should do?

like neil said, synchronous xhr request allow request complete fully. if plan publish addon official mozilla repository, synchronous xhr requests grounds rejection (source).

you may want check out of observer notification, ones dealing application shutdown. also, if you're trying develop model of browser, may user-interaction-inactive observer notification well. ;)


Comments