Bug 430792 - Site's favicon is replaced if browser error page is shown (for ehsan.akhgari@gmail.com, r=dietrich, a=beltzner)

This commit is contained in:
dietrich@mozilla.com 2008-05-07 21:35:08 -07:00
Родитель 76573af049
Коммит ca27ef83a7
3 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -59,6 +59,8 @@
<head>
<title>&loadError.label;</title>
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
<!-- If the location of the favicon is changed here, the FAVICON_ERRORPAGE_URL symbol in
toolkit/components/places/src/nsFaviconService.h should be updated. -->
<link rel="icon" type="image/png" id="favicon" href="chrome://global/skin/icons/warning-16.png"/>
<script type="application/x-javascript"><![CDATA[

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Brett Wilson <brettw@gmail.com> (original author)
* Ehsan Akhgari <ehsan.akhgari@gmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -480,13 +481,15 @@ nsFaviconService::DoSetAndLoadFaviconForPage(nsIURI* aPageURI,
if (pageEqualsFavicon)
return NS_OK;
// ignore data URL favicons. The main case here is the error page, which uses
// a data URL as the favicon. The result is that we get the data URL in the
// favicon table associated with the decoded version of the data URL.
PRBool isDataURL;
rv = aFaviconURI->SchemeIs("data", &isDataURL);
// ignore error page favicons.
nsCOMPtr<nsIURI> errorPageFavicon;
rv = NS_NewURI(getter_AddRefs(errorPageFavicon),
NS_LITERAL_CSTRING(FAVICON_ERRORPAGE_URL));
NS_ENSURE_SUCCESS(rv, rv);
if (isDataURL)
PRBool isErrorPage;
rv = aFaviconURI->Equals(errorPageFavicon, &isErrorPage);
NS_ENSURE_SUCCESS(rv, rv);
if (isErrorPage)
return NS_OK;
// See if we have data and get the expiration time for this favicon. It might

Просмотреть файл

@ -129,4 +129,5 @@ private:
};
#define FAVICON_DEFAULT_URL "chrome://mozapps/skin/places/defaultFavicon.png"
#define FAVICON_ERRORPAGE_URL "chrome://global/skin/icons/warning-16.png"
#define FAVICON_ANNOTATION_NAME "favicon"