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:
parent
9f6319dd71
commit
911e60b507
3 changed files with 6 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -16,6 +16,7 @@ supportedWebViewEvents = [
|
|||
'new-window'
|
||||
'will-navigate'
|
||||
'did-navigate-to-different-page'
|
||||
'did-navigate-in-page'
|
||||
'close'
|
||||
'crashed'
|
||||
'gpu-crashed'
|
||||
|
|
|
@ -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': []
|
||||
|
|
Loading…
Reference in a new issue