Skip to content

Commit

Permalink
Bypass TabFavIconHelper for data: URI favicons
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jul 15, 2023
1 parent e3a15e6 commit a9d8741
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion webextensions/common/tst-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ export class TreeItem {
const [effectiveFavIconUrl, children] = await Promise.all([
(sourceTab.id in this.cache.effectiveFavIconUrls) ?
this.cache.effectiveFavIconUrls[sourceTab.id] :
TabFavIconHelper.getLastEffectiveFavIconURL(sourceTab).catch(ApiTabs.handleMissingTabError),
(sourceTab.favIconUrl && sourceTab.favIconUrl.startsWith('data:')) ?
sourceTab.favIconUrl :
TabFavIconHelper.getLastEffectiveFavIconURL(sourceTab).catch(ApiTabs.handleMissingTabError),
doProgressively(
sourceTab.$TST.children,
child => this.exportTab(child, permissions, commonCacheKey),
Expand Down
6 changes: 6 additions & 0 deletions webextensions/sidebar/components/TabElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,17 @@ windowId = ${tab.windowId}
if (!this.initialized || !this.$TST)
return url;

if (url.startsWith('data:')) { // we don't need to use the helper for data: URI.
this.favicon.src = url;
return url;
}

TabFavIconHelper.loadToImage({
image: this.favicon,
tab: this.$TST.tab,
url
});
return url;
}

get overflow() {
Expand Down

0 comments on commit a9d8741

Please sign in to comment.