webview返回上一页后退,检测是否为最后一页

if (window.history.state.position==0){
   //to do something
} 

同过state判断当前回退页面的索引