var isAndroid=navigator.userAgent.indexOf(“Android”)>-1||navigator.userAgent.indexOf(“Adr”)>-1;
var isIos=navigator.userAgent.match(/(i[^;]+;( U;)? CPU.+Mac OS X/);
history.pushState(null,null,document.URL);//最好加这行
window.addEventListener(“popstate”,_this.popFun,false);
if(isAndroid){
try{
//安卓直接使用popstate监听返回键无效,需要加这行代码
window.tbs_bridge.nativeExec(“network”,“type”,0,null)
}catch(e){
console.log(e)
}
}
popFun(){
console.log(“popFun”)
}