Display favicons for external links

This commit is contained in:
2026-04-10 12:26:34 +02:00
parent ad4f58324a
commit 568039a39b
2 changed files with 13 additions and 0 deletions

12
assets/content.js Normal file
View File

@@ -0,0 +1,12 @@
(function () {
document.querySelectorAll('.content a[href^="http"]').forEach(function (a) {
var hostname = new URL(a.href).hostname;
var img = document.createElement('img');
img.src = 'https://icons.duckduckgo.com/ip3/' + hostname + '.ico';
img.width = 16;
img.height = 16;
img.style.verticalAlign = 'middle';
img.style.marginRight = '3px';
a.prepend(img);
});
})();