Introducing Faviconographer: Favicons for your Safari Tabs
It’s actually possible! Get it here for free.
A few weeks ago, John Gruber wrote about Safari’s lack of Favicons for tabs. With other Mac apps, such as like Mail, this is actually something any developer could “fix” with a plugin. But unfortunately, Apple’s System Integrity Protection prevents injecting such code into Safari.
Around that time, I had been working on some code to read images from Safari’s Favicon database for my app Timing. It uses them to display how much time you’ve been spending on each website, among other things.
For the same purpose, Timing already contained some code to figure out the current Safari tab’s URL.
This made me wonder:
Would it be possible to figure out which Favicons to display for your Safari tabs, then overlay those on top of the Safari window, creating the impression of actual tab Favicons?
With many of the necessary components already in place, I “remixed” them and tweeted an image of the result:
At first, this was an ugly hack, but the positive response to that tweet encouraged me to keep going. I even decided to add gimmicks like displaying Favicons on the Favorites along the way!
And now, the result is finally here:
How does it work, exactly?
Every two seconds (or when it detects an event that indicates that you switched tabs), Faviconographer will perform these steps:
- It asks Safari for a list of all your open tab’s titles and their URLs.
- It asks Safari for a list of the current window’s tabs, with their positions and titles.
- It uses the URLS from step #1 to fetch the corresponding images from Safari’s own Favicon database, then overlays them at the positions determined in step #2.
It’s not as good as a native solution inside Safari, but it works surprisingly well. Which brings us to its…
Due to its unconventional approach, it is not possible to make Faviconographer work completely unnoticeably:
- Faviconographer will only display icons for the currently active Safari window, and only while Safari is the frontmost app.
- There is a minimal delay when switching Safari windows.
- When e.g. dragging tabs on the tab bar or moving/resizing the window, there is some delay before the Favicons update. In the meantime, they just float in the wrong place.
- When invoking the hotkey to show all application windows while in Safari, the Favicons stay floating in place.
- Under High Sierra, if you restore a previous Safari session, Faviconographer can only show icons for restored tabs after you have clicked them at least once. But for all new tabs, Favicons will be shown immediately.
This is a limitation of Safari’s AppleScript support in macOS 10.13 — it won’t return URLs for tabs that have not yet been loaded.
For me, the convenience of having Favicons on my Safari tabs wins out.
Your mileage may vary — just try it yourself 😉
Let me know what you think, either with a comment on Product Hunt or a tweet! (I’m @ daniel_a_a on Twitter.) (And if you happen to like the app, please consider clapping for this article to help spread the word.)