diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 7618d6f2d1c7..3c73e7df7ccb 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -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); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index a5bbded30066..d5cdb0cc6a30 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -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