diff -up surf-0.4.1/config.def.h surf-0.4.1-history/config.def.h
--- surf-0.4.1/config.def.h	2010-06-08 03:06:41.000000000 -0400
+++ surf-0.4.1-history/config.def.h	2010-12-25 20:00:08.000000000 -0500
@@ -5,6 +5,7 @@ static char *progress_trust = "#00FF00";
 static char *stylefile      = ".surf/style.css";
 static char *scriptfile     = ".surf/script.js";
 static char *cookiefile     = ".surf/cookies.txt";
+static char *historyfile    = ".surf/history.txt";
 static time_t sessiontime   = 3600;
 #define NOBACKGROUND 0
 
diff -up surf-0.4.1/surf.c surf-0.4.1-history/surf.c
--- surf-0.4.1/surf.c	2010-06-08 03:06:42.000000000 -0400
+++ surf-0.4.1-history/surf.c	2010-12-25 19:50:51.000000000 -0500
@@ -140,6 +140,7 @@ cleanup(void) {
 	while(clients)
 		destroyclient(clients);
 	g_free(cookiefile);
+	g_free(historyfile);
 	g_free(scriptfile);
 	g_free(stylefile);
 }
@@ -396,6 +397,10 @@ loaduri(Client *c, const Arg *arg) {
 	}
 	else {
 		webkit_web_view_load_uri(c->view, u);
+		FILE *f;
+		f = fopen(historyfile, "a+");
+		fprintf(f, u);
+		fclose(f);
 		c->progress = 0;
 		c->title = copystr(&c->title, u);
 		g_free(u);
@@ -689,6 +694,7 @@ setup(void) {
 
 	/* dirs and files */
 	cookiefile = buildpath(cookiefile);
+	historyfile = buildpath(historyfile);
 	scriptfile = buildpath(scriptfile);
 	stylefile = buildpath(stylefile);
 

