How to know close button of chrome pressed in JavaScript or jquery?

I used windowbeforeunload in my code. It is working fine in internet explorer but it is not working in chrome. Could you please give any suggestion for it.