This works with the correct selectors (also in SMF 2,1 with our Portal system)
/* add Favicon to links with the class "bbc_link", but not in signatures! */
$(':not(.signature)>.bbc_link').each(function() {
var url = $(this).attr('href'),
domain = url.match(/:\/\/(.[^/]+)/)[1],
schema = url.match(/^(http[s]*):\/\//)[1];
$(this).css({
'background-image':'url(//www.google.com/s2/favicons?domain=' + schema + '://' + domain + ')',
'background-repeat':'no-repeat',
'padding-left':'20px',
'background-position':'0'
});
});