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?
世界只因有你2017-06-08 11:05:13
1. If it is a Chrome plug-in, there is a related API
2. Your own web page. You can try focus event
window.addEventListener('focus', function () {});
给我你的怀抱2017-06-08 11:05:13
Click to switch, and then switch the page. At this time, there are two event attributes, the onunload and onbeforeunload events will be called,