This is a known issue,

http://stackoverflow.com/questions/4802007/window-onbeforeunload-not-working-in-chrome