If you open many tabs in Safari for webpages that have Flash content, you've probably noticed Safari's processor usage skyrocket. clicktoflash is an open source Safari (WebKit) plug-in which prevents Flash loading unless you click the graphic representing the Flash content. I find Safari is much more stable as a result and quicker at loading webpages.
[robg adds: An earlier hint discussed using SafariStand to do the same thing. SafariStand, however, is a complex add-on that many users may prefer not to add to Safari. clicktoflash does just one thing, and after testing it for a day or so, I can say it works quite well. In Firefox, I use the FlashBlock plug-in to do the same thing.]
If you want to clean your Safari cookies, but you want to keep certain (login) cookies, you could manually remove cookies from the Safari preferences menu -- Safari » Preferences » Security » Show Cookies. However, that can be time consuming. As an alternative, try this Perl script:
### Edit this to your liking (put a pipe character between two words)
my $keepCookiesWith = "aap|teun|betterbe|tweakers.net";
### Put your OS X short username here (there should be a directory with the same name under /Users)
my $userName = "teun";
### ### ### Don't edit beneath this line unless you know some Perl
my $path = "/Users/$userName/Library/Cookies/Cookies.plist";
my @date = localtime();
my $date = sprintf("%04d%02d%02d", $date + 1900, $date + 1, $date);
my $cookies = read_file($path);
rename ($path, $path . "." . $date);
print WH <<EOF;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
while ($cookies =~ m#(\s*<dict>.+?</dict>)#gs)
my $cookie = $1;
if ($cookie =~ /$keepCookiesWith/)
print WH $cookie;
print WH <<EOF;
This code will back up your Cookies.plist file, and create a new one with only the cookies that match the regex you put in $keepCookiesWith.
To use the script, save the code as cleanSafariCookies.pl (or some other name), somewhere on your hard disk. Put something in $keepCookiesWith and in $userName. Give the file execute permission with chmod 755 cleanSafariCookies.pl, and run it in Terminal by typing (assuming you're in the directory where the program is located) ./cleanSafariCookies.pl.
This could easily be rewritten in the language of your choice, if you desire.
I use the proxy-based ad blocker GlimmerBlocker and visit sites, including Macworld, that use Pheedo. I noticed that the Macworld vodcasts were turning up empty in iTunes. The cause, it turns out, is that GlimmerBlocker blocks Pheedo.
There is a workaround though -- just create your own list, and add a whitelist for host www.pheedo.com, path /click.phdo with priority 3. Then any Pheedo-using sites will work just fine.
I noticed that Safari was getting a bit slow to load the Flash plug-in the first time in every browsing session. After a quick look in my Internet Plug-ins (/Library/Internet Plug-Ins) folder, I found two files related to the Flash Player. A recent one (Flash Player.plugin) and an old one (flashplayer.xpt). After removing the .xpt file, Safari become far snappier to load flash the first time.
I guess the .xpt file is an old version of the plug-in that I dragged with me during successive installs and migrations; I expect a lot of users may have the same issue. (I had the same problem on my home Mac and my work Mac).
Within some online text editors, such as TinyMCE, Firefox (on a MacBook) will handle Command-Left Arrow as 'go back one page' rather than 'go to the start of the current line.' Likewise, Command-Right Arrow will take you forward a page, but if there's not a page to go forward to, this often results in moving the cursor to the end of the current line after all.
To see this in action, go here, and from that page, go to Examples and then to Documentation. Now, go back one page. On the Examples page, change some text and hit Command-Left Arrow while the cursor is still within the editor. Firefox will take you back another page, losing any changes you made. If you try the same thing in Safari, it would simply move the cursor to the start of the current line. Likewise, for Command-Right Arrow, Firefox takes you forward to Documentation, where Safari would move the cursor to the end of the current line.
The solution is simple -- use the keyconfig add-on. After installing keyconfig, go to Tools » Keyconfig, click on the "Back : Command-Left Arrow" entry, then click the Disable button. Next, select the "Forward : Command-Right Arrow" entry and click Disable. That's all. To navigate from page to page, use Command-[ and Command-].
While we're at the subject, if you don't want Delete/Backspace to take you the previous page when your cursor happens to be outside any textbox, see this hint. You could probably accomplish the same result by using keyconfig by disable the "Back : Backspace" shortcut.
[robg adds: When I tested this hint in Firefox 3.0.5, the modified text in the TinyMCE editor showed up, even after going forward or back away from the page. If you're interested in learning more about keyconfig, this hint explains in a bit more depth about how to use it to set up your own keyboard shortcuts for commands that don't have menu item entries.]
For the paranoid, the pornsurfer, as well as anyone with a not-undue concern about online tracking, it is useful to be able to automatically delete all cookies when quitting one's browser.
For most of the history of Safari, although the browser did not provide a way of erasing all cookies at shutdown, the facility could be emulated by setting one's ~/Library » Cookies » cookies.plist file to "read only" (see this hint). Since cookies are stored in memory until the browser shuts down, the result was a perfectly normal browser session with no cookies carried to the next session.
This ability went away with 10.5, as a read-only cookie file caused random issues at most sites requiring a login cookie. There was no option but to reset the cookie.plist file to read/write, and delete them by hand every now and then.
The problem has been resolved in 10.5.6, but the technique for achieving it is slightly different -- you now must set the containing folder to read-only, not the file. Read on for a detailed walkthrough, if you need it...
Today, I had a process running amok and filling up my boot volume. This was bad, as Safari seems to have tried to update my RSS feeds and failed in the process, leaving a Database3_BROKEN file in my user's Library/Syndication folder. This was especially annoying as I have a backlog of hundreds of unread articles. On several sites, this amounts to more articles having been accumulated than entries in their respective RSS feeds. It would have required a lot of work to check all the sites I have subscribed to manually. So I set out to find a solution that did not involve trashing my old Syndication database.
If the command above works without errors, the Database3-repaired file is probably OK and you can rename it to Database3. The best thing about this is that it may serve you in many other similar cases on Mac OS X, as SQLite is very widely used. Thus a more general version of the command:
sqlite3 broken.db .dump | sqlite3 repaired.db
A word of caution though: check the repaired database carefully before relying on it. According to the somewhat unrelated discussion that led to this solution, this may not work for a database if the application using it died in the middle of a commit. This can result in both records and index being broken. In any case, this should be worth a try.
A couple of sites I use are asking for an upgrade to Flash Player 9.0.115 to run certain apps (Snapfish & Facebook, for example). I'm running OS X 10.3.9 which is not compatible with Flash Player 10. Can I still get Flash Player 9.0.115? I've got 9.0.47 now. Not finding what I want digging around on the Adobe site.
As it turns out, it is available, but apparently not on the Adobe site. User macosnoob found it on macromedia.com -- caution, this is a 134MB download link: Adobe Flash Player 9.0.115. If you're running an older Mac and need the last version of Flash Player 9, the above link should get the job done.
YouTube just added a new quality level, in addition to normal quality and high quality: 720p high definition! As such, I've modified another bookmarklet previously posted as a hint here so that it now downloads these 720p HD versions in H.264 QuickTime .mp4 glory, ready for use with iTunes, Apple TV, with no transcoding required.
To use it, just drag the bookmarklet from this page to your Bookmarks bar, then click it while viewing a YouTube 720p HD video.
[robg adds: For those interested, here's the source code of the bookmarklet:
When clicked, the bookmarklet will place a new download link into the gray box on the right-hand side of the YouTube page. Depending on your browser, you can Control-click the link and save the target of the link. In Firefox, I just Option-clicked the link, and it worked. I did have to rename the downloaded file, as it was originally named get_video.htm. After renaming with an mp4 extension, the video played perfectly. (I used this video for testing.)]
Open the Bookmarks manager.
Create a new bookmark on your bookmarks bar with the Name set to resize and the Location set to this string: