Skip to content

Commit

Permalink
Fix favicons for normal tabs (history and bookmarks worked)
Browse files Browse the repository at this point in the history
fixes #270
  • Loading branch information
kesselborn committed Jan 2, 2019
1 parent aeac771 commit 999f576
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions conex-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,18 @@ const renderEntry = function(url, title, id, favIconUrl, drawBookmarkIcon, drawA
]),
]);

if (bg.settings['show-favicons'] && favIconUrl && favIconUrl.startsWith('http')) {
fetch(favIconUrl, { method: "GET", }).then(res => {
if (res.ok) {
$1('img', element).src = favIconUrl;
} else {
console.error(`error fetching favicon for ${favIconUrl} -- response was`, res);
}
}, e => console.error(`error fetching ${favIconUrl}: ${e}`));
if (bg.settings['show-favicons'] && favIconUrl) {
if(favIconUrl.startsWith('http')) {
fetch(favIconUrl, { method: "GET", }).then(res => {
if (res.ok) {
$1('img', element).src = favIconUrl;
} else {
console.error(`error fetching favicon for ${favIconUrl} -- response was`, res);
}
}, e => console.error(`error fetching ${favIconUrl}: ${e}`));
} else if(favIconUrl.startsWith('data:image')) {
$1('img', element).src = favIconUrl;
}
}

return element;
Expand Down

0 comments on commit 999f576

Please sign in to comment.