目标
有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);
});