зеркало из https://github.com/mozilla/gecko-dev.git
Bug 696433 - Improve link rel scanning for favicons [r=mbrubeck]
This commit is contained in:
Родитель
384b178ad2
Коммит
4f76153bcc
|
@ -1130,7 +1130,7 @@ abstract public class GeckoApp
|
|||
}
|
||||
|
||||
void handleLinkAdded(final int tabId, String rel, final String href) {
|
||||
if (rel.indexOf("icon") != -1) {
|
||||
if (rel.indexOf("[icon]") != -1) {
|
||||
final Tab tab = Tabs.getInstance().getTab(tabId);
|
||||
if (tab != null) {
|
||||
tab.updateFaviconURL(href);
|
||||
|
|
|
@ -1235,13 +1235,24 @@ Tab.prototype = {
|
|||
if (target.ownerDocument.defaultView != this.browser.contentWindow)
|
||||
return;
|
||||
|
||||
// sanitize the rel string
|
||||
let list = [];
|
||||
if (target.rel) {
|
||||
list = target.rel.toLowerCase().split(/\s+/);
|
||||
let hash = {};
|
||||
list.forEach(function(value) { hash[value] = true; });
|
||||
list = [];
|
||||
for (let rel in hash)
|
||||
list.push("[" + rel + "]");
|
||||
}
|
||||
|
||||
let json = {
|
||||
type: "DOMLinkAdded",
|
||||
tabID: this.id,
|
||||
href: resolveGeckoURI(target.href),
|
||||
charset: target.ownerDocument.characterSet,
|
||||
title: target.title,
|
||||
rel: target.rel
|
||||
rel: list.join(" ")
|
||||
};
|
||||
|
||||
// rel=icon can also have a sizes attribute
|
||||
|
|
Загрузка…
Ссылка в новой задаче