Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Extend Safari's History to a full year Web Browsers
I've always wanted a longer History record in Safari, and since last November I've had it. If you go into the Safari prefs file and change the following lines, I think you'll get a full year of History recording: Quit Safari, then open com.apple.Safari.plist, located in your user's Library/Preferences folder, using your favorite text editor. Search for WebKitHistoryAgeInDaysLimit, and change that section to look like this:
 <key>WebKitHistoryAgeInDaysLimit</key>
 <string>365</string>
 <key>WebKitHistoryItemLimit</key>
 <string>9999</string>
I don't know whether there is any negative effect to changing these parameters, but so far, my History appears to work correctly and Safari seems stable. Feedback or comments appreciated.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[26,505 views]  

Extend Safari's History to a full year | 25 comments | Create New Account
Click here to return to the 'Extend Safari's History to a full year' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Extend Safari's History to a full year
Authored by: donfarrar on Mon, Mar 21 2005 at 10:43AM PST
Beware of the Law of Large Numbers.

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: marianco on Mon, Mar 21 2005 at 11:14AM PST
The longer the history, the longer it takes Safari to start up.

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: stevec on Mon, Mar 21 2005 at 11:30AM PST
curiously enough my .plist file did not have this key in it WebKitHistoryAgeInDaysLimit So I added it. So far no issues but only time will tell. I didn't set my age that high, 60 days and 1500 items is sufficient for me

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: baltwo on Fri, Jun 10 2005 at 4:18PM PDT
It's not there unless you add it. See /System/Library/Frameworks/WebKit.framework/Versions/A/Headers/WebHistoryItem.h file (Tiger—I don't run Panther anymore, so I don't know if it's applicable there). It discusses a "HistoryAgeInDaysLimit which one can use to set the maximum number of days to be read from stored history."

Thus,

defaults write com.apple.safari WebKitHistoryAgeInDaysLimit 30

adds it to the plist.

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: mozart11 on Mon, Mar 21 2005 at 11:56AM PST
Why? It slows down enough if more than 25 as is.

[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: Bookman on Mon, Mar 21 2005 at 12:55PM PST
I work in a public library environment, and, what with privacy concerns, we would love to use Safari, but feel we can't because we haven't found a way to turn the browser's history completely off. If you use a utility like TinkerTool to set the Safari history to zero days, Safari still maintains a list of websites visited today in the History Menu under Earlier Today. I suspect this is because of SnapBack. Just a hunch, but I guess that SnapBack uses that Earlier Today list to provide it with the addresses it needs to function.

If there were a way to remove the Earlier Today item from the History menu, we'd be able to set up Safari for the public, acknowledging that SnapBack would probably be unusable. Any ideas how this might be done?

--Books

[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: ibroughton on Mon, Mar 21 2005 at 1:34PM PST
If you set it to

<key>WebKitHistoryItemLimit</key>
<string>000</string>

then it will clear both the history, and the "Visited earlier today" section when you quit safari. Maybe a step in the right direction?

---
The server is up but the site is down and I don't know which direction you are trying to go

[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: TheTSArt on Mon, Mar 21 2005 at 10:00PM PST
What about just using the Reset Safari... command in the Safari menu? When I go to an Apple Store and check my mail, I always use that command afterwards.

[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: Caol on Tue, Mar 22 2005 at 12:25AM PST
Setting:
	<key>RecentHistoryMenuItemsLimit</key>
	<string>0</string>
Along with setting those keys mentioned above to zero, seems to work, but could probably use some kicking around to make sure.

[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: Caol on Tue, Mar 22 2005 at 12:40AM PST
Well....

I spoke too soon. It would appear that the "Earlier Today" list is kept in memory. It does seem to be reset on a quit/restart of Safari, and the actual 'History' is empty.


[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: Bookman on Tue, Mar 22 2005 at 3:12PM PST
I spoke too soon. It would appear that the "Earlier Today" list is kept in memory. It does seem to be reset on a quit/restart of Safari, and the actual 'History' is empty.
This has always been my experience. No matter what you use to zero out the history settings, that "Earlier Today" thing is always running, even if it gets reset upon closing the window or quitting the application. As I said, I have to believe this is so SnapBack won't be broken (even if we don't mind if it is).

--Books

[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: dougness on Tue, Mar 22 2005 at 10:38PM PST
Do you have people logout between sessions? If so I believe you can address the privacy issue by using a login script to refresh the entire home directory of the default user. A "clean" reference version of the home directory is previously saved and stored in a management area (like in the machine's Library directory) to do the refreshing with. This is how we run our Macs at school and I'm pretty sure no part of the browser history crosses sessions (I will check though). This also has the added benefit of restoring all settings for the default user account at the beginning of each session. Of course this approach would depend on reliably logging out between users.

[ Reply to This | # ]
Yes, but is it possible to turn the history off?
Authored by: dougness on Wed, Mar 23 2005 at 9:55AM PST
I verified this morning that the approach of refreshing the default users home directory clears out any trace of browser history from the previous sessions (I guess it would be pretty weird if it didn't).

So it would preserve privacy without having to hack away at Safari (plus - history and snapback are features that you might want your patrons to be able to use).

Anyway, if you are interested in setting your machines up this way (using a login script) this site is a good resource (check out LoginWindow Manager and the Deployment area). You'd just have to do some thinking about how to make sure folks logout (set an idle time logout, have a big red logout button widget, post a sign on each machine...)

[ Reply to This | # ]

Kiosk Mode
Authored by: dzurn on Tue, Mar 22 2005 at 7:00PM PST
You can use the Saft plugin to run Safari in Kiosk mode. This hint shows how to run Saft's Kiosk only for a particular user (otherwise all users get Kiosk mode).

---
Madness takes its toll.
Please have exact change.

[ Reply to This | # ]

Yes, but is it possible to turn the history off?
Authored by: KenaiTheMacFan on Sun, Jul 10 2005 at 9:21PM PDT
Private Browsing.

---
Ian

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: dogboy on Mon, Mar 21 2005 at 12:57PM PST
OmniWeb has an option for this in the prefs, just so you know. Not sure if it slows things down as I don't want to delete anything.

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: joeholmes on Mon, Mar 21 2005 at 1:30PM PST
Interesting -- my prefs files didn't have any WebKitHistoryAgeInDaysLimit setting at all. This is all I found (and you can see I changed the Item Limit to 1000, from 100):

        <key>WebIconDatabaseDirectoryDefaultsKey</key>
	<string>/Users/joe/Library/Safari/Icons</string>
	<key>WebKitHistoryItemLimit</key>
	<string>1000</string>
	<key>WebKitInitialTimedLayoutDelay</key>
	<string>0.25</string>
I wonder why I have no days limit?

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: CrankyMacGuy on Mon, Mar 21 2005 at 1:50PM PST
Inexplicably, Safari sometimes loses this information. I haven't been able to track down when or why it happens. Just last week my iBook's install of Safari suddenly stopped remembering past 24 hours. The key for days was missing from the plist. Sometimes it is this way right from a clean install. It's almost Windowsian in nature. One install has a history of a week, another doesn't.

---
~Life...don't talk to me about life.

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: qwerty denzel on Tue, Mar 22 2005 at 1:10AM PST
I think this can be altered using OnyX or something of the sort so you may have done that. Safari probably has no need to save this value on first use, many hidden features that can be enabled by changing preferences files (such as with the Finder) need to have new entries added into the plist file since they are 'hidden'.

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: revdave on Fri, Jun 10 2005 at 8:39PM PDT
Also did not have a 'days limit'.

As a matter of fact, I went so far as to delete the entire preference file and then let it recreate itself by booting up safari. When I quit safari and reloaded the preference file it was one quarter of this size and did not have any of these webkit parameters!

So the question is where did these parameters come from in the first place - since it seems that safari does not create them? Is it some kind of third-party application such as cocktail or tinkertool?

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: stevecc on Wed, Aug 31 2005 at 12:46AM PDT
Just add the missing line:

WebKitHistoryAgeInDaysLimit 365

I did and it works

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: kholburn on Tue, Mar 22 2005 at 5:12PM PST
I chose a different strategy. The idea is to back up the safari history file each day.

I created a small script ~/sbin/backup.browser.history:

#!/bin/sh

dir="/Users/fred/Library/Safari/"
file="$dir/History.plist"
back="$dir/History/`date '+history-%Y-%m-%d.plist'`"

if [ ! -f "$file" ]; then
  exit
fi

/bin/cp "$file" "$back" 


Then I created a crontab entry using crontab -e
$ crontab -l
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour    mday    month   wday    who     command
#
5 19 * * * /Users/fred/sbin/backup.browser.history

If you use vim you might need to use the setting :
:set nobackup

to get cronbtab -e to work.



[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: ptejad on Thu, Mar 31 2005 at 7:27PM PST
It's infinitely safer to do it this way (especially if Apple decides to change plist formats,hint,hint,hint):

defaults write com.apple.Safari WebKitHistoryItemLimit 9999
defaults write com.apple.Safari WebKitHistoryAgeInDaysLimit 365

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: gifutiger on Sat, Jul 2 2005 at 9:20PM PDT
Help, I'm sure that I'm missing something here! The file was easy to find, I opened it with "TextEdit" couldn't find the line indicated in the posting, so I pasted the recommend lines into the com.apple.safari.plist however when I saved the file the system over wrote the file and made a new one of it's own choosing. So when I re-opened the file everything that was there was new. Completely new, as the file which had been 8k was now 4k in size. Another side effect was the all of my "Safari Preferences" had went back to default.

[ Reply to This | # ]
Extend Safari's History to a full year
Authored by: yang on Sun, Jul 10 2005 at 9:33PM PDT
If you're using Tiger, the .plist files are maintained in some XML format which TextEdit does not support (in saving). You've got to use the property list editor which is part of the developer tools package.

[ Reply to This | # ]