зеркало из https://github.com/mozilla/gecko-dev.git
Bug 598174 - Frontend loads the favicon unconditionally [r=mark.finkle]
This commit is contained in:
Родитель
6b6db34169
Коммит
231c3bd940
|
@ -111,11 +111,7 @@
|
||||||
try {
|
try {
|
||||||
// Use documentURIObject in the favicon construction so that we
|
// Use documentURIObject in the favicon construction so that we
|
||||||
// do the right thing with about:-style error pages. Bug 515188
|
// do the right thing with about:-style error pages. Bug 515188
|
||||||
let iconURI = Services.io.newURI(self.documentURI.prePath + "/favicon.ico", null, null);
|
self.loadFavicon(self.documentURI.prePath + "/favicon.ico", null);
|
||||||
if (!iconURI.schemeIs("javascript") && !gFaviconService.isFailedFavicon(iconURI)) {
|
|
||||||
gFaviconService.setAndLoadFaviconForPage(self.currentURI, iconURI, true);
|
|
||||||
self.mIconURL = iconURI.spec;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(e) {}
|
catch(e) {}
|
||||||
}
|
}
|
||||||
|
@ -138,11 +134,7 @@
|
||||||
let linkType = self._getLinkType(link);
|
let linkType = self._getLinkType(link);
|
||||||
switch(linkType) {
|
switch(linkType) {
|
||||||
case "icon":
|
case "icon":
|
||||||
let iconURI = Services.io.newURI(link.href, link.charset, null);
|
self.loadFavicon(link.href, link.charset);
|
||||||
if (!iconURI.schemeIs("javascript") && !gFaviconService.isFailedFavicon(iconURI)) {
|
|
||||||
gFaviconService.setAndLoadFaviconForPage(self.currentURI, iconURI, true);
|
|
||||||
self.mIconURL = iconURI.spec;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "search":
|
case "search":
|
||||||
self._searchEngines.push({ title: link.title, href: link.href });
|
self._searchEngines.push({ title: link.title, href: link.href });
|
||||||
|
@ -163,6 +155,30 @@
|
||||||
})
|
})
|
||||||
]]></field>
|
]]></field>
|
||||||
|
|
||||||
|
<method name="loadFavicon">
|
||||||
|
<parameter name="aURL"/>
|
||||||
|
<parameter name="aCharset"/>
|
||||||
|
<body><![CDATA[
|
||||||
|
let iconURI = Services.io.newURI(aURL, aCharset, null);
|
||||||
|
if (this.shouldLoadFavicon(iconURI)) {
|
||||||
|
gFaviconService.setAndLoadFaviconForPage(this.currentURI, iconURI, true);
|
||||||
|
this.mIconURL = iconURI.spec;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.mIconURL = "";
|
||||||
|
}
|
||||||
|
]]></body>
|
||||||
|
</method>
|
||||||
|
|
||||||
|
<method name="shouldLoadFavicon">
|
||||||
|
<parameter name="aURI"/>
|
||||||
|
<body><![CDATA[
|
||||||
|
let docURI = this.currentURI;
|
||||||
|
return (!gFaviconService.isFailedFavicon(aURI) && docURI && ("schemeIs" in docURI) &&
|
||||||
|
(docURI.schemeIs("http") || docURI.schemeIs("https") || docURI.schemeIs("about") || docURI.schemeIs("chrome")));
|
||||||
|
]]></body>
|
||||||
|
</method>
|
||||||
|
|
||||||
<method name="_getLinkType">
|
<method name="_getLinkType">
|
||||||
<parameter name="aLink" />
|
<parameter name="aLink" />
|
||||||
<body><![CDATA[
|
<body><![CDATA[
|
||||||
|
|
Загрузка…
Ссылка в новой задаче