Skip to content

[Tabs Runner] Rework handling of favicons

Kai Uwe Broulik requested to merge work/tabsrunnerfavicons into master

It seems on Chrome more often than not when having dozens of pages open, the approach of using a timeout of 100ms for fetching from cache doesn't cut it and requests are queued up and time out.

This patch improves the situation by:

  • reducing the number of requests being made in the first place by collecting a set of favicons first, since when having multiple tabs of the same website open (e.g. multiple news articles one wants to read), there's no point in requesting the same favicon multiple times in a row
  • caching the fetched favicon data so that subsequent queries, e.g. while you type, benefit from the favicon look up of the first query. The cache is evicted after a minute to not pile up an unlimited amount of data URLs
  • Using Promises and Array algorithms for better structure

Requests on Chrome, especially subsequent ones are a lot quicker, and I tend to have less missing favicons.

I didn't observe this timeout behavior on Firefox, however finding browser tabs also seems noticeably quicker.

Edited by Kai Uwe Broulik

Merge request reports