add two option onBeforeDoNavigate and onEndNavigate