Quantcast
Channel: rtrouton – Der Flounder
Viewing all articles
Browse latest Browse all 764

Setting New Window and New Tab behavior in Safari

$
0
0

While testing a new machine setup today, I noticed that Safari wasn’t opening to the default homepage like it should. Instead, it was opening Safari’s Top Sites.

Top Sites

There wasn’t an obvious way to set the Safari new window setting from the command line, but with the assistance of Greg Neagle, I’ve mapped out the applicable keys and their settings. See below the jump for the details.

The behavior of new Safari windows is set by the NewWindowBehavior key in /Users/username/Library/Preferences/com.apple.Safari.plist. Likewise, new Safari tabs are set by the NewTabBehavior key in /Users/username/Library/Preferences/com.apple.Safari.plist.

Both keys use an integer to set the desired behavior. Here’s how it maps out:

com.apple.Safari NewWindowBehavior

com.apple.Safari NewWindowBehavior 0 = Homepage

Screen Shot 2013-08-16 at 1.46.39 PM


com.apple.Safari NewWindowBehavior 1 = Empty Page

Screen Shot 2013-08-16 at 1.46.43 PM


com.apple.Safari NewWindowBehavior 2 = Same Page

Screen Shot 2013-08-16 at 1.46.45 PM


com.apple.Safari NewWindowBehavior 3 = Bookmarks

Screen Shot 2013-08-16 at 1.46.47 PM


com.apple.Safari NewWindowBehavior 4 = Top Sites

Screen Shot 2013-08-16 at 1.46.35 PM

com.apple.Safari NewTabBehavior

com.apple.Safari NewTabBehavior 0 = Homepage

Screen Shot 2013-08-16 at 1.46.22 PM


com.apple.Safari NewTabBehavior 1 = Empty Page

Screen Shot 2013-08-16 at 1.46.26 PM


com.apple.Safari NewTabBehavior 2 = Same Page

Screen Shot 2013-08-16 at 1.46.09 PM


com.apple.Safari NewTabBehavior 3 = Bookmarks

Screen Shot 2013-08-16 at 1.46.31 PM


com.apple.Safari NewTabBehavior 4 = Top Sites

Screen Shot 2013-08-16 at 1.46.19 PM

Here’s the defaults commands to set the NewWindowBehavior and NewTabBehavior keys to the various available settings:

Set new Safari windows to open to Safari’s default homepage:

defaults write com.apple.Safari NewWindowBehavior -int 0 

Set new Safari windows to open to an empty page:

defaults write com.apple.Safari NewWindowBehavior -int 1

Set new Safari windows to open to the same site as the last-opened page:

defaults write com.apple.Safari NewWindowBehavior -int 2

Set new Safari windows to open the Safari bookmarks page:

defaults write com.apple.Safari NewWindowBehavior -int 3

Set new Safari windows to open the Safari Top Sites page:

defaults write com.apple.Safari NewWindowBehavior -int 4

Set new Safari tabs to open to Safari’s default homepage:

defaults write com.apple.Safari NewTabBehavior -int 0

Set new Safari tabs to open to an empty page:

defaults write com.apple.Safari NewTabBehavior -int 1

Set new Safari tabs to open to the same site as the last-opened page:

defaults write com.apple.Safari NewTabBehavior -int 2

Set new Safari tabs to open the Safari bookmarks page:

defaults write com.apple.Safari NewTabBehavior -int 3

Set new Safari windows to open the Safari Top Sites page:

defaults write com.apple.Safari NewTabBehavior -int 4



Viewing all articles
Browse latest Browse all 764

Trending Articles