document.addEventListener('visibilitychange', function () { let pageVisibility = document.visibilityState; // 页面变为不可见时触发 if (pageVisibility == 'hidden') { console.log("离开时间点:" + new Date()); } // 页面变为可见时触发 if (pageVisibility == 'visible') { window.location.href = "https://dh.new-game.cn/index/index/episodeSuccess"; } })
标签:index,再切,跳转,new,pageVisibility,页面 From: https://www.cnblogs.com/zdcblog/p/17719375.html