philc/vimium — pull request #1232 by smblott-github (2014-11-09 10:58:25+00:00)
Title: Substantial reworking of favicons (Mark II).

Continuation of #1210. Fixes favicons.

The good:

- Favicons look good.
- Favicons are fetched on the background page (so no CSP issues).
- Uses Google's little globe if no other favicon is found (and every suggestion gets at least this favicon).
- Only uses `chrome://favicon/` to fetch favicons. So we only get a custom favicon if chrome has one cached.
- *No guessing favicon URLs!* Guessing is a poor approach.
- Caches favicons in both the content page and the background page. Both caches make a noticable difference to how quickly the favicons are populated.

The bad:

- This is a *whopping* amount of code for such a basic feature.

You could argue that the two core functions (`getFavicons` on the content page and `getFavicon` on the background page) are actually quite concise. And the rest of the code is tests, utilities and infrastructure (which we just happen not to have needed before).

Fixes #1208.