If you'd like to remove your Safari history files when you log out, first create the following shell script:
#!/bin/bash
# Point this at your user folder.
useroot=/Users/your_user
# Clear Safari History (except for bookmarks).
rm -f $useroot/Library/Safari/Downloads.plist $useroot/Library/Safari/History.plist
rm -f $useroot/Library/Safari/HistoryIndex.sk $useroot/Library/Safari/TopSites.plist
rm -f $useroot/Library/Safari/WebpageIcons.db $useroot/Library/Safari/LastSession.plist
# Add any additional clean-up here.
Save the script somewhere, make it executable, and because it runs as root, make sure it is protected from modification. Then copy and paste this command into Terminal, modifying it to point to wherever you put the above script:
To be complete, you should also visit Safari's Preferences, open the AutoFill tab, and clear all of the checkmarks (Safari then won't remember passwords and forms).
One thing I hate about Safari 4 is the relocation of the reload button to the right side of the URL entry area. Sure, you can still use Command-R , but for those who prefer navigating with their mouse alone, here's a cool tip to somewhat solve your problem!
So, drag any of the buttons from my post to the far left of your bookmarks bar, and you've got a simple JavaScript reload button, just half an inch away from where the old one used to be! I've even been nice enough to create different designs using the "Special Characters..." dialog box in all Cocoa applications.
The simple javascript is:
javascript:location.reload(true)
I made them into buttons using some special characters like these: ⤶ ⌘ ⏎ ⎋
Yes, I know, if you use haxies you get what you deserve. But to this day, Spotlight, enhanced custom keystrokes and all, and in spite of my overall hatred for the mouse versus a good keystroke combo, there are just a ton of things I find easier to do with a right-click and Contextual Menu action when I am in certain work (or leisure) modes, especially Web research and just plain surfing. But the price is getting higher.
Summary of this hint: I was having a spinning beacbhall hang issue in Safari. After some work, I figured out that it was caused by FruitMenu's contextual menu support. Temporarily disabling the contextual menu support -- without quitting or logging out -- instantly ended the Safari hang-up and I was able to start using it again without losing any work.
Read on if you'd like more background on the Safari problems I was having, and how I diagnosed and solved them...
Do you find yourself constantly using the 'Other...' item in Safari's Develop » User Agent menu to simulate User Agents that aren't shown in the list? If so, it's easy to permanently add your own favorites by editing the UserAgents.plist file in the Resources directory of the bundle.
I recommend making a copy of Safari.app, then Control-click your copy and select Show Package Contents from the pop-up menu. Navigate into Resources and edit the file UserAgents.plist in any decent text editor to include your faves.
I am syncing, on several Macs and several user accounts, information such as Calender, Mail Rules, Bookmarks, etc. After recently updating to Safari 4.01 and OS X 10.5.7, all of a sudden I had all very bad Safari performance -- including constant freeze situations. After being ready to delete the impacted user, I realized that there were some issues with the database.sqlite3 file in the Library » PubSub » Database folder. The PubSub folder is used for tracking RSS feeds, and it seems my problem resided there.
After deleting the database.sqlite file, and reseting the Mobile Me information, the freezes and crashes stopped. Hope this helps others, too.
Grab the favicon (that tiny graphic right before the "http" in the url) and drag it to Safari 4's Top Sites button in the Bookmarks Bar. Alternatively, if you customize the Toolbar to show the Top Sites button, you get a larger target and it works the same way. This has to be the easiest way to get something into Top Sites.
As a test, I showed it to my Mom over Timbuktu and she got it right away. If it passes the Mom test, I think it's pretty good.
I've been archiving web pages using Safari's one-file web archive format for a while. I was trying to figure out a bulk conversion method if I want to send these archives to Windows users, or switch to a different browser. It turns out that Scott Garner's Download URL as PDF Automator action can take web archive files from the Finder and will convert them to PDFs (in addition to its intended function of downloading pages off the web.)
Just download the Automator action, then create a workflow with Find Finder Items hunting through your home directory for files that have the extension webarchive. That action should feed into Scott's action, and you're all set. The action has some options, including whether or not the PDF should be split into pages.
Just a quick note to those who, like me, greatly miss the 'tabs in the title bar' feature of Safari 4 Beta in the final release of Safari:
After installing Safari 4.0 Final, I was quite disappointed to no longer have the 'tabs in title bar,' but I still had both the app and the installer from the last Safari 4 Public Beta (remember there were two main versions; the last one was published on May 12) on another disk, and I noticed that it launches just fine using all the underpinnings of the final version.
I'm sure it's not 100% compatible, but we all know that most of the meaningful components of Safari are *not* in the app itself. In fact, I'm using it right now to write this.
In short, you can install the final Safari 4.0, then use Pacifist to extract just the app from the Public Beta disk image. Better yet, if you still have the beta, rename it to something like Safari_beta.app, and you'll be able to use the tabs in the title bar again, as well as any of the customization tricks found here and elsewhere.
[robg adds: I haven't tested this one, as I no longer have the beta installer around. I also don't know what issues, if any, this may cause.]
I don't know if this was already documented, but in addition to using Command-click on the Safari window title to show the nested directories for a web site, Safari 4 lets you do it with a right-click (or Control-click) of the mouse as well.
[robg adds: I was positive we had this documented here, but I can't find it while searching now. If it's been posted before, please let me know.]