mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 696433 - Improve link rel scanning for favicons [r=mbrubeck]
This commit is contained in:
parent
77aefa4612
commit
20cda4349a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user