Power users often have dozens of documents open in Safari at any one time, some possibly for months at a time, and it can be infuriating to have Safari crash or for some other reason lose everything you had open. Here's how to get it all back.
I tend to accumulate too many open web documents. Right now, I have ten windows up, each of which has four or more open web pages, and that's only because I just went through and closed a bunch I didn't need. I've had some open for months, because I haven't gotten around to reading them, or because I've been actually using them this whole time (on and off) for a project.
As far as browsers go, Safari isn't too bad, but its crash protection is basically nonexistent, or at least it was when I started using Tiger. At the time, I installed Saft, and I never looked back. Even with Saft, however, Safari isn't perfectly reliable. There are a number of ways that your session might be lost. Safari or an in-process add-on might corrupt memory, thereby corrupting your session info. There might be a kernel panic at just the wrong time. Another sure way to destroy your session is to quit the browser while in Private Browsing mode. (No session info gets stores on quit, so when you reopen, 'Reopen All Windows From Last Session' gives you nothing or junk.) And another way is to start Safari with no internet connection, try (and fail) to reload your last session, and then quit. (Now, connection errors are your last session.)
This hint assumes that you do very regular backups. I have a Time Capsule and therefore backup every hour while at home. This is important. If you don't have a backup from just before you lost your session, you're out of luck.
If you are not using Saft, then the file you need to find is:
If you ARE using Saft, it seems to interfere with sessions being saved in LastSession.plist (mine contains mostly Top Sites tabs), and in any case, it stores its session restore info in an entirely different place:
First, quit Safari. Then find whichever one is right for you and make a backup copy. Click on the filename, and then enter Time Machine. Now, the trick is to figure out how far back you have to go to find the most recent valid session. This may take a few tries. Restore the file from backup to its original location. Then restart Safari. If you're using Saft, the session will restore automatically. If not, you'll have to select 'Reopen All Windows From Last Session' from the History menu. You may have to try again if you picked one that was too old or too new (corrupted or post-corruption).
[crarko adds: I haven't tested this one. It is a use for Time Machine I might not have thought of on my own.]
A recent video project required me to download MP4 files from our streaming partner's site. When I would click a link, however, the video would play in Safari, and there wasn't a way to right-click on the link and download it, as you can do with other kinds of files. So how do I download the MP4?
Open the Downloads window in Safari and paste the URL into it. The download will start immediately.
[crarko adds: This is generally worth trying for hard to download files.]
When Apple introduced smooth scrolling it conflicted with my use of the Control key in the shortcut to change Spaces. I would scroll down a page and then switch sSaces. This would cause the page to be zoomed in/out when I returned to Firefox. The following prevents this behavior:
Enter about:config in the Firefox address bar. Click to get through the warning page.
Search for mousewheel.withcontrolkey.
Set the mousewheel.withcontrolkey.action to 0.
Set the mousewheel.withcontrolkey.numlines to 0.
Ensure mousewheel.withcontrolkey.sysnumlines is false
You can find further documentation of the about:config page here.
[crarko adds: I tested this, and it works as described.]
Somebody at Apple seems to be on a crusade against LCD subpixel antialiased font rendering. Recent versions of WebKit, included with Safari 5, introduced an unfortunate CSS option for web developers to override your preferred choice of text smoothing.
A setting of -webkit-font-smoothing: antialiased is now in Apple's global base.css file, effectively degrading text readability on all of Apple's web properties, including all of www.apple.com, the iTunes Store or the Mac App Store.
Thankfully, just as it is overriding your choice through CSS, Safari offers a mechanism to add your own CSS rules to have the final say. Create a plain text file with the following contents:
Firefox does not exhibit this problem. I'm not sure if it's a bug in WebKit or just Safari (5.0.3).
To get Safari to save the page just click on the URL in the address field and rename the link and the Save button will become active. Just backspacing on the last character of the link and then re-entering it is sufficient.
[crarko adds: I tested this, and it works as described. You can still print the page to PDF in Safari without doing this but if you want to save it as an HTML file, this will help on some of those problematic pages. Chrome and OmniWeb could both save the example page without trouble, so this looks like a Safari bug.]
I use Firefox as my primary browser, and I spend a fair bit of time looking at source code. I've always just opened the source view in Firefox (Command+U), then copied-and-pasted the text to Coda or BBEdit, etc. if I needed to do something with it. While searching for something else today, though, I stumbled on a couple of advanced Firefox settings that let me save the copy-and-paste step -- Command-U now opens the page's source directly in Coda.
To do this, you need to enter about:config in Firefox's URL bar, then accept the warning when prompted. In the Filter box, type source.editor, which will show you three variables. Double-click on view_source.editor.external first, to change its Value to true. Next, double-click on view_source.editor.path, which will drop down a small sheet in which you enter the path to your preferred editor. The path must be a full complete Unix-style path, and point to the actual executable (not the app bundle). So for Coda, I used:
For BBEdit, you need to actually point to the command-line version (/usr/local/bin/bbedit)...and to do that, you'll have to have first installed the command line tools within BBEdit itself. Other editors should work; just dig into the bundle (Show Package Contents in Finder's contextual menu) to find the name of the actual binary. Click OK to dismiss the sheet, and you're done.
From now on, Command+U should open the page source in your chosen editor. If it fails, it'll just open directly in Firefox. To revert the behavior, just open about:config again, and set the view_source.editor.external back to false.
[crarko adds: I tested this, and it works as described. One of my favorite features of OmniWeb was the built-in source editor, but this is even more flexible and powerful.]
Then, bookmark it in Safari. I called it ':' so that it wouldn't take up much space, and put it right after my Gmail bookmark so the result is: 'Gmail :(1)'.
In the RSS tab of Safari Preferences, set the Check for update: menu to 30 Minutes so that you have current results.
Now, send yourself an email.
Once the feed refreshes (you can quit and reopen Safari to do this manually), you should see the number of unread messages in your inbox in parentheses after your bookmark.
[crarko adds: I tested this, and it works as described. I had to play with the URL a bit to get it to work right; in the original hint it was given as feed:https://mail.google.com/mail/feed/atom/inbox/. That didn't seem to work for me so I just went to the Gmail inbox in Safari and switched into RSS mode and grabbed the link now listed in the hint.]
I've noticed more and more sites displaying full page ads over the content which only disappear after the advertisement is finished playing. Safari 5 provides a quick way to get to textual content without viewing the ad.
Simply enter Safari's 'Reader' mode to see the main content of the page instantly. For other browsers, Arc90 Lab's bookmarklet Readability does the trick as well.
[crarko adds: You won't always be able to switch to Reader mode in Safari 5; it's dependent on the markup used on the site in question. Readability is the more flexible solution, and ClickToFlash may be helpful as well in some cases. Of course ad creators are aware of these tools, and come up with creative ways to foil them. Hopefully that same creative thought can be used to make the ads themselves more interesting. That does seem to be one of the goals of iAd. I wonder how big a dent Apple will ultimately make in that industry.]
It can be useful to have a clickable file on your Desktop or in the Dock that takes you straight to a specified website. It can be even more useful to have websites open automatically when you log in to your computer.
From either Safari, Chrome, or Firefox, you can make one of these files (it will have a .webloc extension) easily. Just click and drag from any website element that gives you a hand cursor to your desktop or a Finder window. You'll get a file takes you straight to the website that the link lead to. Opening this file will open your default web browser to this website.
You can keep this in a folder, put it on your Desktop or in your Dock, or set it to open at login. To put it in your dock, just drag it there like any other file. To open it at login, go to the Login Items tab of the Accounts pane of System Preferences. Click the plus button and navigate to and select your file.