Catching a tab close event in web browser?

前端 未结 7 2378
我寻月下人不归
我寻月下人不归 2020-12-18 08:45

Is there any way of knowing if the user closes a tab in a web browser? Specifically IE7, but also FireFox and others as well. I would like to be able to handle this situatio

7条回答
  •  渐次进展
    2020-12-18 09:19

    I'm sure the OP is asking from the context of the web page itself, but for any Firefox-addon-developers who come across this question, you can use the TabClose event. https://developer.mozilla.org/en/Code_snippets/Tabbed_browser#Notification_when_a_tab_is_added_or_removed

提交回复
热议问题