ksafari: Commands to take back control

Last modified: Mar 7, 2021 1:33 PM
1 835 Last modified Mar 7, 2021 1:33 PM
Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software products that may be mentioned in the topic below. Apple encourages you to first seek a solution at Apple Support. The following links are provided as is, with no guarantee of the effectiveness or reliability of the information. Apple does not guarantee that these links will be maintained or functional at any given time. Use the information below at your own discretion.


Safari Users Toolchest
* {Type|Copy|Drag-and-Drop} all text in red in Terminal

#1. Quit Safari

#2. Open Terminal

#3. Safari History Clean, type into terminal:
computer$ rm -fr ~/Library/Safari/History.plist

#4. Safari Downloads Clean, type into terminal:
computer$ rm -fr ~/Library/Safari/Downloads.plist

#5. Safari Icons Cache Clean, type into terminal:
computer$ rm -fr ~/Library/Safari/Icons/* 2

#6. Turn off Safari Caches for Broadband Users (Speedup for people who don't web upload files)

To enable this behaviour, type into terminal:
computer$ rm -fr ~/Library/Caches/Safari;ln -s /dev/null ~/Library/Caches/Safari

To disable this behaviour (use when temporarily enabling the above if you need to upload a file with Safari), type into terminal:
computer$ rm ~/Library/Caches/Safari

#7. Turn off Safari Icon Caching (Speedup)

To enable this behaviour, type into terminal:
computer$ rm -fr ~/Library/Safari/Icons;ln -s /dev/null ~/Library/Safari/Icons

To disable this behaviour, type into terminal:
computer$ rm ~/Library/Safari/Icons

#8. Remove the imposed time delay to read web pages

To enable this behaviour, type into terminal:
computer$ defaults write com.apple.Safari WebKitInitialTimedLayoutDelay 0.000001

To disable this behaviour, type into terminal:
computer$ defaults delete com.apple.Safari WebKitInitialTimedLayoutDelay

#9. Ensure extra security is enabled preventing Safari from automatically opening downloaded files without the users control, type into terminal:
computer$ defaults write com.apple.Safari AutoOpenSafeDownloads -boolean false

#10. Run Safari, feel the joy

Optional & Troubleshooting Enhancements:

[Limit the History to a specific number of websites (last 10 for example)]
computer$ defaults write com.apple.Safari WebKitHistoryItemLimit 10

[Make Safari download PDF documents as it did in OS X versions prior to 10.4.x Tiger]
To enable this behaviour, type into terminal:
computer$ defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES

To disable this behaviour, type into terminal:
computer$ defaults delete com.apple.Safari WebKitOmitPDFSupport

[Turn on the Debug menu]
To enable this behaviour, type into terminal:
computer$ defaults write com.apple.Safari IncludeDebugMenu -boolean true

To disable this behaviour, type into terminal:
computer$ defaults write com.apple.Safari IncludeDebugMenu -boolean false

[Remove Google Search Bar]
To enable this behaviour, type into terminal:
computer$ defaults write com.apple.Safari AddressBarIncludesGoogle -boolean false

To disable this behaviour, type into terminal:
computer$ defaults write com.apple.Safari AddressBarIncludesGoogle -boolean true

[Reset Safari from thinking it has imported IE favorites]
computer$ defaults write com.apple.Safari IEFavoritesWereImported -boolean false

[Reset Safari from thinking it has imported Netscape/Mozilla favorites]
computer$ defaults write com.apple.Safari NetscapeAndMozillaFavoritesWereImported -boolean false

Jan J.


Do you want to provide feedback on this User Contributed Tip or contribute your own? If you have achieved Level 2 status, visit the User Tips Library Contributions forum for more information.
Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.