diff --git a/mozilla/suite/browser/navigator.js b/mozilla/suite/browser/navigator.js index 6aad91b1254..f8f41e6fad7 100644 --- a/mozilla/suite/browser/navigator.js +++ b/mozilla/suite/browser/navigator.js @@ -121,6 +121,19 @@ function UpdateBookmarksLastVisitedDate(event) } } +function HandleBookmarkIcon(iconURL, addFlag) +{ + var url = _content.location.href; + if (url) { + // update URL with new icon reference + if (!gBookmarksService) + gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"] + .getService(Components.interfaces.nsIBookmarksService); + if (addFlag) gBookmarksService.UpdateBookmarkIcon(url, iconURL); + else gBookmarksService.RemoveBookmarkIcon(url, iconURL); + } +} + function UpdateInternetSearchResults(event) { // XXX This somehow causes a big leak, back to the old way diff --git a/mozilla/suite/browser/navigator.xul b/mozilla/suite/browser/navigator.xul index 3e2bff78341..55914854947 100644 --- a/mozilla/suite/browser/navigator.xul +++ b/mozilla/suite/browser/navigator.xul @@ -189,8 +189,8 @@ Contributor(s): ______________________________________. --> ondraggesture="PageProxyDragGesture(event);"/> + onload="this.parentNode.selectedIndex = 1; event.stopPropagation(); event.preventBubble(); HandleBookmarkIcon(this.src, true);" + onerror="gBrowser.addToMissedIconCache(this.src); HandleBookmarkIcon(this.src, false);"/> diff --git a/mozilla/suite/browser/navigatorOverlay.xul b/mozilla/suite/browser/navigatorOverlay.xul index 262ed9d97f6..5a8aedc8fc3 100644 --- a/mozilla/suite/browser/navigatorOverlay.xul +++ b/mozilla/suite/browser/navigatorOverlay.xul @@ -329,7 +329,9 @@ - diff --git a/mozilla/suite/browser/nsBrowserStatusHandler.js b/mozilla/suite/browser/nsBrowserStatusHandler.js index 7a11a004424..c3178bc663f 100644 --- a/mozilla/suite/browser/nsBrowserStatusHandler.js +++ b/mozilla/suite/browser/nsBrowserStatusHandler.js @@ -166,7 +166,15 @@ nsBrowserStatusHandler.prototype = onLinkIconAvailable : function(aHref) { if (gProxyFavIcon && pref.getBoolPref("browser.chrome.site_icons")) + { gProxyFavIcon.setAttribute("src", aHref); + + // update any bookmarks with new icon reference + if (!gBookmarksService) + gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"] + .getService(Components.interfaces.nsIBookmarksService); + gBookmarksService.UpdateBookmarkIcon(this.urlBar.value, aHref); + } }, onProgressChange : function (aWebProgress, aRequest,