Delay the page-title-set event to next tick
This commit is contained in:
parent
83ee78451a
commit
c95117fb22
2 changed files with 6 additions and 2 deletions
|
@ -520,9 +520,9 @@ void WebContents::DidNavigateMainFrame(
|
|||
void WebContents::TitleWasSet(content::NavigationEntry* entry,
|
||||
bool explicit_set) {
|
||||
if (entry)
|
||||
Emit("page-title-set", entry->GetTitle(), explicit_set);
|
||||
Emit("-page-title-set", entry->GetTitle(), explicit_set);
|
||||
else
|
||||
Emit("page-title-set", "", explicit_set);
|
||||
Emit("-page-title-set", "", explicit_set);
|
||||
}
|
||||
|
||||
void WebContents::DidUpdateFaviconURL(
|
||||
|
|
|
@ -76,6 +76,10 @@ wrapWebContents = (webContents) ->
|
|||
# until next tick.
|
||||
setImmediate => @emit 'did-fail-load', args...
|
||||
|
||||
# Delays the page-title-set event to next tick.
|
||||
webContents.on '-page-title-set', (args...) ->
|
||||
setImmediate => @emit 'page-title-set', args...
|
||||
|
||||
# Deprecated.
|
||||
deprecate.rename webContents, 'loadUrl', 'loadURL'
|
||||
deprecate.rename webContents, 'getUrl', 'getURL'
|
||||
|
|
Loading…
Reference in a new issue