add did-navigate-in-page event to webview & webcontents (triggers on hash/ref changes, anchor links...), pass url into events

This commit is contained in:
leethomas 2016-01-01 14:43:02 -08:00
parent 9f6319dd71
commit 911e60b507
3 changed files with 6 additions and 2 deletions

View file

@ -566,7 +566,9 @@ void WebContents::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
if (details.is_navigation_to_different_page())
Emit("did-navigate-to-different-page");
Emit("did-navigate-to-different-page", params.url);
else if (details.is_in_page)
Emit("did-navigate-in-page", params.url);
}
void WebContents::TitleWasSet(content::NavigationEntry* entry,

View file

@ -16,6 +16,7 @@ supportedWebViewEvents = [
'new-window'
'will-navigate'
'did-navigate-to-different-page'
'did-navigate-in-page'
'close'
'crashed'
'gpu-crashed'

View file

@ -17,7 +17,8 @@ WEB_VIEW_EVENTS =
'console-message': ['level', 'message', 'line', 'sourceId']
'new-window': ['url', 'frameName', 'disposition', 'options']
'will-navigate': ['url']
'did-navigate-to-different-page': []
'did-navigate-to-different-page': ['url']
'did-navigate-in-page': ['url']
'close': []
'crashed': []
'gpu-crashed': []