关闭/返回模态窗口

i want to run a customer satisfaction survey on the actions: - close browser - close tab - back button

It seems like its hard to access and modify the default handlers for these events.

Is there anyone beeing successfull with it? I have heard that since early this year this should be possible.

Any ideas?