Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
Clear favicon when the favicon is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn authored and eoger committed Nov 18, 2017
1 parent f7d8a89 commit ffa0ac4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/tab.js
Expand Up @@ -141,9 +141,12 @@ SideTab.prototype = {
const imgTest = document.createElement("img");
imgTest.src = favIconUrl;
imgTest.onerror = () => {
this._iconView.style.backgroundImage = "";
this.resetIcon();
};
},
resetIcon() {
this._iconView.style.backgroundImage = "";
},
setLoading(isLoading) {
toggleClass(this.view, "loading", isLoading);
if (isLoading) {
Expand Down
6 changes: 5 additions & 1 deletion src/tablist.js
Expand Up @@ -648,7 +648,11 @@ SideTabList.prototype = {
setIcon(tab) {
let sidetab = this.getTab(tab);
if (sidetab) {
sidetab.updateIcon(tab.favIconUrl);
if (tab.favIconUrl) {
sidetab.updateIcon(tab.favIconUrl);
} else {
sidetab.resetIcon();
}
}
},
setLoading(tab, isLoading) {
Expand Down

0 comments on commit ffa0ac4

Please sign in to comment.