Adding Top Sites in Safari 4 Beta
Safari 4 beta was released just a few days ago, and I really like it so far. The only issue I have run into so far is that there appears to be no way to add sites to the Top Sites list. There it apparently a way to drag-and-drop, but I couldn’t get it working. There is another way, and it turns out to be fairly simple.
First, open Finder and go to /Users/yourname/Library/Safari and open TopSites.plist. This will bring up the Plist Editor with a Windows registry style database. Under Root, there should be 3 subitems: BannedURLStrings, DisplayedSitesLastModified, and TopSites. The first one stores any sites you have removed from the list by clicking the X in edit mode (to get to edit mode, click the edit button on the Top Sites page. You can use it to pin and delete sites, but not add them). DisplayedSitesLastModified probably stores when Safari last refreshed the images of each site. TopSites stores the list of top sites, and this is the one we are interested in editing.
Each TopSite entry is a key in the format “Item #” where # is a number from 1 to however many sites you have and keeps track of the order in which sites display, and the type of each item is Dictionary. The Plist Editor assigns the numbers for you (since the type is Array). Under each item, there are 2-5 keys. At the minimum, there is an entry for TopSiteTitle, which contains the title, and TopSiteURLString, which contains the URL (both String format). If the site is pinned, it will have a Boolean value called TopSiteIsPinned set to true (checked). If the site has a feed, it will have a String called TopSiteFeedURLString and a Boolean called IsUnread.
The easiest way to add a new Top Site is to select an existing site with the same number of keys as the one you want to add, then hit command+c to copy it, then select the item you want to add it after and hit command+v to paste. Make sure you the item you want to add it after is collapsed or the new item will be pasted as a child of the item you selected. Now, just edit the URL and title (though the title might be updated automatically), save the .plist, and you are done.
Updates:
1. I did not realize that Property List Editor.app does not come with Leopard by default. For me it is in /Developer/Applications/Utilities, so it was probably installed with Xcode. You can download it by itself here from Apple.
2. There is a drag-and-drop way to add sites, but it only works if the Top Sites page is open in its own window. I’m guessing that this is a bug because it makes adding items to Top Sites very non-obvious.
