[rellect] Favicon For Links

[rellect] Favicon For Links 3.0.1

No permission to download
Favicons started not working for me suddenly. Like some do work, some doesn't. Anyone else having the same issue?
 
Favicons started not working for me suddenly. Like some do work, some doesn't. Anyone else having the same issue?

I can confirm this.

I think there is another add-on for the same purpose around here, but I'm not finding.

If someone knows, please share with us.
 
Favicons started not working for me suddenly. Like some do work, some doesn't. Anyone else having the same issue?
Everything is still working fine on my side, even with the adjustment to remove favicons for my own site.

Only some will not show, and as a world, if they don't have a favicon or their headers pass something other than an OK status (even though viewable).
 
Everything is still working fine on my side, even with the adjustment to remove favicons for my own site.

Only some will not show, and as a world, if they don't have a favicon or their headers pass something other than an OK status (even though viewable).
Even my internal links, so stuff from my own board has no favicons. I will try to reinstall the addon, it seems a problem specific to me, thanks.
 
yes actually i did also notice this recently.....forgot we even had this addon installed, but i noticed it most where internal links to the old vb version of the site still use the favicon, but now somewhere along the way they stopped working for the main, xenforo version...

a bit suspect about the unfurled snippets being inconsistent as well but that could be a number of things still...nice to hear anyway we arent the only ones having a problem..
 
  • Like
Reactions: sbj
Even my internal links, so stuff from my own board has no favicons. I will try to reinstall the addon, it seems a problem specific to me, thanks.
Maybe it's a conflict with a newer version of XF? I'm still on 2.1.5a.
 
  • Like
Reactions: sbj
The tool works great with XF 2.1.10 PL2

I'm not sure what you mean, but if you want to disable it in specific forums, try adding to your css something like
CSS:
body[data-container-key="node-15"] .link.has-favicon {
    background: none !important;
    padding: 0px !important;
}
Replace 15 with the relevant forum id.

Thanks for that tipp but it is too much todo with this.

MyWay:

Activate the XF developer mode, then go to
/admin.php?template-modifications/
and look for "[rellect] Favicon For Links"
open there the template "helper_js_global".
scoll down @ "replace" and change:

Before:
Code:
<!--XF:JS-->
<xf:if is="'public' === $app">
   <xf:macro template="rellect_favicon" name="script" />
</xf:if>

After:
(The NodeIDs here are only examples and must be adapted to your circumstances.)
Code:
<!--XF:JS-->
<xf:if is="!in_array($__globals.forum.node_id, [1,2,3,4,5])">
<xf:if is="'public' === $app">
<xf:macro template="rellect_favicon" name="script" />
</xf:if>
</xf:if>

Now in the forums whose IDs are used above, FavIcons are no longer used and Google no longer receives metadata ...
So with us in all "private" forums ... :D

@rellect
Perhaps it is possible for you to integrate this, and the code for internal links above in another post, into the settings of your add-on. Then it would be even more useful than it already is. It is already one of my "CoolTools" because it implements so much functionality with so much speed in XF.
 
Last edited:
That AddOn still works great for me on XF 2.2.4.
Except that that Google S2 API has become rather useless and is more often returning their default favicon rather than actual domains' favicons.
Thankfully you can easily modified this AddOn template to use GitHub favicon API instead.

JavaScript:
//https://www.google.com/s2/favicons?domain=
var matches = link.getAttribute('href').match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
var domain = matches && matches[1];  // domain will be null if no match is found
link.style.backgroundImage = "url('https://favicons.githubusercontent.com/" + domain + "')"

See: https://stackoverflow.com/a/8498629/3969362
 
Actually GitHub favicon service is far from perfect either.
I had implemented some clever AJAX version that would use both services to get the best favicon but that won't work on production because of cross site security issues. Instead I did a not so clever implementation with hardcoded URL target per hostname. It can also invert favicon color if needed for those of us running dark themed forums.
 

Attachments

Actually GitHub favicon service is far from perfect either.
I had implemented some clever AJAX version that would use both services to get the best favicon but that won't work on production because of cross site security issues. Instead I did a not so clever implementation with hardcoded URL target per hostname. It can also invert favicon color if needed for those of us running dark themed forums.
For anyone using my mod published above as a ZIP file. It looks like http://favicons.githubusercontent.com went offline lately resulting in missing favicons. Since those guys were still not on Google S2 and since my mod does extract the hostname already anyway I just started using the actual favicons URLs in that map. Like:

PHP:
const KHostNames = {
    "stackoverflow.com": { url:KRequestFaviconGoogle+"stackoverflow.com", invert:0 },
    "theregister.co.uk": { url:KRequestFaviconGoogle+"theregister.co.uk", invert:1 },
    "github.com": { url:"https://github.com/favicon.ico", invert:1 },
    "android.googlesource.com": { url:KRequestFaviconGoogle+"googlesource.com", invert:0 },
    "developer.android.com": { url:"https://developer.android.com/favicon.ico", invert:0 },
    "download.lenovo.com": { url:KRequestFaviconGoogle+"lenovo.com", invert:0 }
};

Then I'm wondering why was this not implemented like that in the first place? I guess at some point I'll modify that plug-in to fetch the icons from http://<hostname>/favicon.ico by default.

To configure this yourself just go to Admin > Add-ons > Favicons for Links > Settings > Public template and edit rellect_favicon.
 
Last edited:
For the original dev... This addon ends up showing generic icon for all links if you minimize script tags using the [Nulumia] XFOptimize addon. Just a fyi!
 
So, getting generic icon on 2.3B3. Not sure if the developer is still active on the community. Would really miss this addon on 2.3 if this remains unmaintained.
 
Ah. Looks like this one also uses jQuery. And I guess 2.3's slim bundled version does not meet the requirements.
 
I wouldn’t use a slim down version of jQuery in my addons, it’s time to adapt to the times, not hold back and use outdated stuff.
 
yeah i mean i was just hoping that it would have worked because of the slim bundle. but i continue to get generic icons so i guess not. 🙂
 
Top Bottom