监听ios底部bar返回事件

监听ios底部bar返回事件

//跳转之前加上 window.history.pushState(null, null, "#");
window.history.pushState(null, null, "#");
window.location.href = 'https://www.baidu.com'; //你走后~

//监听到返回事件
window.addEventListener("popstate", function(e) { 
    console.log(“你终于回来了~”)
}, false);