Common
监听url变化
(function(history){
var pushState = history.pushState;
history.pushState = function(state) {
if (typeof history.onpushstate == "function") {
history.onpushstate({state: state});
}
webkit.messageHandlers.hashchangeMessageHandler.postMessage(222);
webkit.messageHandlers.hashchangeMessageHandler.postMessage(window.location.href);
return pushState.apply(history, arguments);
}
})(window.history);
window.onpopstate = history.onpushstate = function(e) {
webkit.messageHandlers.hashchangeMessageHandler.postMessage(111);
webkit.messageHandlers.hashchangeMessageHandler.postMessage(window.location.href);
}