Clear Safari history automatically when closed

safari4_topsites


It is quite common for some people to delete the history, so here I am going to leave you this trick so that it is only deleted every time you close Safari. It will be a useful hack for some, although Firefox and your 3.5 version private browsing may be faster for this.

Step 1:: Create a file safariborrar.sh and paste this content:

#!/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.

Step 2: Open a terminal and put this (be careful to change your_user):

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

It is done! Done.

Source | Mac OS X Hints


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Carlbert said

    It's a good trick, but as for what you say about "Firefox and its private browsing version 3.5" it turns out that Safari has had the same option for a long time and is in the menu Safari / Private Browsing.

    Regards…

  2.   Carlinhos said

    Damn, I did not know that my mother read me here hahahahahaha xD

  3.   your mother said

    It will be a useful hack for some, although Firefox and your 3.5 version private browsing may be faster for this.
    It turns out that Safari has already had that option for a long time .. 🙂

  4.   Place said

    Forgiveness!!!!! and what do I put instead of «your user»