Favicons for Google Reader

By sethaurus Last update Nov 17, 2009 — Installed 395,875 times.

no longer working?

Subscribe to no longer working? 13 posts, 10 voices

alala Scriptwright

i really like this script. has it stopped working or is it just me?

ludoo Scriptwright

No, you're right !!
Image are no more <img src/> but background-image instead.
Code must be reviewed.
Adding a img src and inside <span class="icon sub-icon"> seems to be ok.

I'm waiting the update. There will be an update, isn't it ??

Good job, i really like this script !

Julieee User

Oh thank God I'm not the only one! I've been trying to fix it for hours now!

Please update the code soon, I miss my little Favicons.

dengpeng User

I have the problem 2...

ludoo Scriptwright

Hi everybody,

Have fast fix it :
Works under FF3.
This code could improve (img element creation/deletion)...

Can be downloaded/installed from my site or from my space


// ==UserScript==
// @name Google Reader: Show Feed Favicons
// @author henrah / LudoO(xeoos.fr)
// @namespace http://henrah.googlepages.com
// @include htt*://www.google.*/reader/view*
// ==/UserScript==

var Favicons = {
UNFIXED_ICON_XPATH: '//span[contains(@class,"icon sub-icon")][not(@label)]',
EXPORT_URL: '/reader/subscriptions/export',
FAVICON_URL: ['http://', '/favicon.ico'],

PARSE_DOMAIN: /:\/\/([\w\.]+)/,

domains: {},
cacheIcons: {},

loadDomains: function () {
var xhr = new XMLHttpRequest();
xhr.open('get', this.EXPORT_URL, true);
xhr.onload = function(){

parseDomain: function(url) {
var match = this.PARSE_DOMAIN.exec(url);
return match && match[1];

setDomains: function (opmlDoc) {
var outline, i = 0,
outlines = opmlDoc.getElementsByTagName('outline');

while (outline = outlines[i++]) {
if (! outline.hasAttribute('htmlUrl')) continue;
var title = outline.getAttribute('title');

if (title.length > 24)
title = title.substr(0, 21) + '...';

this.domains[title] =
|| this.parseDomain(outline.getAttribute('xmlUrl'));
setInterval(function () {
}, 2000);

fixAllIcons: function () {
var icon, i = 0, label;
var uncorrectedIcons = document.evaluate(this.UNFIXED_ICON_XPATH, document, null, 6, null);
while (icon = uncorrectedIcons.snapshotItem(i++)) {
label = icon.nextSibling.firstChild.textContent;
var urlIcon = this.FAVICON_URL.join(this.domains[label]);
var img = document.createElement('img');
icon.setAttribute('label', label);
img.setAttribute('style', 'display:none');
img.src = urlIcon;

img.addEventListener("error", function(e){
}, false);

img.addEventListener("load", function(e){
var FAVICON_STYLE= ['background: url(', ');'];
e.target.parentNode.setAttribute('style', FAVICON_STYLE.join(e.target.src));
}, false);



dengpeng User

Thanks ludoo, it works fine!

heartilly Scriptwright

hey author..
fix it..

i love your script so much

sethaurus Script's Author

I've fixed it now! Let the celebrations commence. I changed the script before reading this topic, but thanks anyway for your suggestions, ludoo.

willandbeyond User

Hmm, not working on my end still. Running Firefox 3.0.6.

Lore User


I confirm that it doesn't work in Firefox 3.0.7 too, it's because of the document.querySelectorAll method, that AFAIK is not supported in FF 3.0.x but only in FF 3.1.
Is there any supported method (something like a getElementById) that does the same as querySelectorAll?

dengpeng User

Yes, I tried FF 3.1beta2, it worked fine, but 3.0.7 didn't work... There are many users using 3.0.x, so henrah, please move on :)

JS365 User

Thanks ludoo. Good job!
It works great with my FF 3.0.10.

Bakahashi User

It seems not to be working again.