Event triggered when switching from b page tab to a page tab
欧阳克2017-06-08 11:03:13
0
2
956
Maybe there are multiple tab pages opened in the browser. How to get the event when the user switches back to the specified page, such as the tab of page a? And execute the specified js?
1. If it is a Chrome plug-in, there is a related API
2. Your own web page. You can try focus event
Click to switch, and then switch the page. At this time, there are two event attributes, the onunload and onbeforeunload events will be called,