1 Nov 2010 12:22
WebKit favicon for bookmarks and history
In an app that supports browsing using WebKit, I want to use cached favicons from sites for menus for history and bookmarks. For the history I can in theory use -[WebHistoryItem icon] to get the cached icon. The problem with this is that this only uses icons for sites that were loaded during the run, not icons cached on disk from previous runs. So somehow reading the cached database is not working. BTW, I have confirmed that the icon database is in fact enabled (WebIconDatabaseEnabled pref is set to YES), and also that the icon database file is changed by my app, and includes new items (database located at default location ~/Library/Icons/WebpageIcons.db, but I also have tried it with a custom location set through the WebIconDatabaseDirectoryDefaultsKey pref). For the bookmarks, I can find no API whatsoever, only SPI through the private WebIconDatabase class. Is there a reason this class is not made private? the header does like designed as for a public class, and it certainly has public uses. Is there another, public, way to get to it? I am somewhat surprised it does not work, given that several webkit based browser, such as Safari and OmniWeb, do use favicons for the history and bookmarks. Are they actually using SPI? Thanks, Christiaan
RSS Feed