目标
有app跳轉到app目标頁,無app跳轉到下載下傳頁,或者跳轉到appstore。
方案一
window.location.href = localPageUrl;
let timer = setTimeout(() => {
window.location.href = downloadUrl;
}, 2000);
document.addEventListener('visibilitychange webkitvisibilitychange', () => {
clearTimeout(timer);
});
window.addEventListener("pagehide", () => {
clearTimeout(timer);
});