Chromium Code Reviews| Index: ios/web/web_state/js/resources/navigation.js |
| diff --git a/ios/web/web_state/js/resources/navigation.js b/ios/web/web_state/js/resources/navigation.js |
| index 4e299d553316b37fc7be88697bb9eea167018342..325d09184f269e2e6548a06b492d1349105a100c 100644 |
| --- a/ios/web/web_state/js/resources/navigation.js |
| +++ b/ios/web/web_state/js/resources/navigation.js |
| @@ -8,6 +8,7 @@ |
| goog.provide('__crWeb.navigation'); |
| +goog.require('__crWeb.common'); |
| goog.require('__crWeb.message'); |
| /** Beginning of anonymouse object */ |
| @@ -66,6 +67,21 @@ goog.require('__crWeb.message'); |
| }; |
| /** |
| + * Handles document load completion tasks. Invoked from |
| + * [WKNavigationDelegate webView:didFinishNavigation:], when document load is |
| + * complete. |
| + */ |
| + __gCrWeb.didFinishNavigation = function() { |
|
Eugene But (OOO till 7-30)
2017/04/12 21:33:08
Do you want to move this to legacy.js instead?
|
| + // Send the favicons to the browser. |
| + __gCrWeb.message.invokeOnHost({'command': 'document.favicons', |
| + 'favicons': __gCrWeb.common.getFavicons()}); |
| + |
| + // Add placeholders for plugin content. |
| + if (__gCrWeb.common.updatePluginPlaceholders()) |
| + __gCrWeb.message.invokeOnHost({'command': 'addPluginPlaceholders'}); |
| + } |
| + |
| + /** |
| * Intercept window.history methods to call back/forward natively. |
| */ |
| window.history.back = function() { |
| @@ -117,6 +133,11 @@ goog.require('__crWeb.message'); |
| }; |
| window.addEventListener('hashchange', function(evt) { |
| + // Because hash changes don't trigger __gCrWeb.didFinishNavigation, so fetch |
| + // favicons for the new page manually. |
| + __gCrWeb.message.invokeOnHost({'command': 'document.favicons', |
| + 'favicons': __gCrWeb.common.getFavicons()}); |
| + |
| __gCrWeb.message.invokeOnHost({'command': 'window.hashchange'}); |
| }); |