Javascript solution for closing browser

I would like to create a message warning when users "x" out their browser. I've searched the boards, but the only solutions I can find seem to be outdated. They suggest altering HTML or Javascript code in the HTML files that I can't seem to find. I'm wondering if anyone has recently implemented something like this and can point me in the right direction. I would appreciate any insight!

Thanks in advance :)

1 Reply