Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Permanently change Safari's User Agent string Web Browsers
Most know about enabling the Develop menu in Safari, and how to pick a different user agent using its User Agent entry. However, Safari will revert to automatic mode between launches; it will not remember your setting. Here's how to improve it's memory and remember your setting between launches.

In order to make the User Agent setting stick between launches of Safari, one has to edit a plist file (just entering the User Agent string in the Custom option of the User Agent menu won't stick). To make the changes, quit Safari and open your user's com.apple.safari.plist file, which you'll find in your user's Library/Preferences folder in an editor capable of opening binary plist files. (Otherwise, you'll have to convert it between binary and ASCII first.)

In the plist file, find CustomUserAgent, and edit the value string. To determine the value string to use for your desired user agent, hover above the desired entry in the Develop » User Agent menu. Enter that value, save the file and relaunch Safari, and you should be good to go. Note that this was only tested on 10.5.7 with Safari 4.0.1.

A non-editing alternative is to use MacPilot, which will do the same thing for you.
  Post a comment  •  Comments (7)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (8 votes cast)
 
[24,162 views] Email Article To a Friend View Printable Version
Enable the Debug menu in Safari 4 Web Browsers
So robg and I were discussing another hint submission of mine, one that robg couldn't understand because it referred to a menu he didn't have. After some back and forth, it turned out that the core of the suggestion for this new hint was actually on the site for a year, but buried at the bottom of a lengthy comment string.

The original hint covered how to enable the Debug menu in Safari, and dates back to 2003. With the advent of Safari 4, this command no longer worked. But somehow, I had a Debug menu and robg did not. The key is in a comment made by chleuasme, posted at the tail end of the comment thread on the original Enable the Safari debug menu hint. In the latest versions of Safari, the Debug menu is activated with a slightly different Terminal command:
defaults write com.apple.Safari IncludeInternalDebugMenu 1
As chleuasme also noted in their comment, this is publicly posted on the WebKit site.

[robg adds: I hadn't ever noticed the comment about how to enable the Debug menu in newer versions of Safari, and it's definitely worth sharing as a full hint. So thanks to chleuasme for finding it originally, and to Frederico for figuring out why I couldn't get the Debug menu to show up.]
  Post a comment  •  Comments (16)  
  • Currently 2.27 / 5
  You rated: 3 / 5 (11 votes cast)
 
[24,527 views] Email Article To a Friend View Printable Version
Force Safari 4 to re-render a page Web Browsers
I've been having troubles with Safari 4 and rendering issues on my Mac. Pages will load fine, but then any little thing, such as scrolling, can cause display issues, as seen in the image at right (click it for the full-size version).

Instead of reloading the entire page, which can be a slow process depending on connection speed and page complexity, I use Safari 4's Debug menu (Enable the Debug menu in Safari 4), which has a new Force Repaint command (Shift-Command-R). If the page can be rendered correctly, it will be done instantly, without waiting on a reload. This works to fix my rendering issues, at least until I can figure out the cause of my display issues.
  Post a comment  •  Comments (15)  
  • Currently 1.56 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (9 votes cast)
 
[8,681 views] Email Article To a Friend View Printable Version
Remove Safari history files on logout via shell script Web Browsers
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:

sudo defaults write com.apple.loginwindow LogoutHook "/Users/your_user/scripts/privacy.sh"

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).

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (14)  
  • Currently 1.55 / 5
  You rated: 2 / 5 (11 votes cast)
 
[15,787 views] Email Article To a Friend View Printable Version
Create a Reload button on Safari 4's bookmarks bar Web Browsers
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: ⤶  ⌘ ⏎ ⎋
  Post a comment  •  Comments (10)  
  • Currently 1.14 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[10,616 views] Email Article To a Friend View Printable Version
Solve an apparent 'stuck Safari' crash without losing work Web Browsers
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...
read more (581 words)   Post a comment  •  Comments (7)  
  • Currently 2.27 / 5
  You rated: 4 / 5 (11 votes cast)
 
[10,460 views] Email Article To a Friend View Printable Version
Edit Safari's list of User Agents in the Develop menu Web Browsers
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.

Simple, yet effective.
  Post a comment  •  Comments (3)  
  • Currently 2.38 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (8 votes cast)
 
[6,973 views] Email Article To a Friend View Printable Version
One possible fix for Safari freezes and slowdowns Web Browsers
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.
  Post a comment  •  Comments (11)  
  • Currently 2.58 / 5
  You rated: 1 / 5 (12 votes cast)
 
[42,952 views] Email Article To a Friend View Printable Version
Easily add a site to Safari 4's Top Sites page Web Browsers
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.
  Post a comment  •  Comments (3)  
  • Currently 2.56 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (9 votes cast)
 
[48,682 views] Email Article To a Friend View Printable Version
Bulk convert Safari's Web Archives to PDFs Web Browsers
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.
  Post a comment  •  Comments (6)  
  • Currently 1.86 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[20,300 views] Email Article To a Friend View Printable Version