This page describes the utility browser-history, a client-side X daemon maintaining a browser-independent global history of all the web sites you visited.
On this page ( http://www.inria.fr/koala/colas/browser-history) you will find:
Browser-history came from the will to overcome a Netscape bug: there was no global history, and if you close a window, its whole history is lost. For people browsing lots of sites, having a possibility to track back where one has been before means that you dont have to put everything in your bookmarks file. If you are not sure if a site may be worth remembering, don't add it in your bookmarks. If you need it later, just browse your history files.
Later, it came to our minds that this also could be a valuable add-on to people writing experimental browsers, so they dont have to add this functionality to their browser itself, and to users able thus to track their web history regardless of the browser they used.
Browser-history is a small and efficient daemon. Real user services could be built on top of the log files it maintains for more possibilities (graphical representation, advanced search options, collective histories). It can be seen as a quick-and-dirty hack wrt to the general solution of using a personal proxy to provide this history and housekeeping facilities. But in the meantime, it is easy to use and it works.
And now that Netscape has a semi-decent history, browser-history is still valuable, as it is difficult to search in the netscape history, its file format is not defined, and entries expire after some time.
The X distribution license: you can do everything with this code (selling
it, modifying it), except suing me or using my name in your
advertisements, or expecting any kind of support or guarantee.
Just run the program each time you launch your X server. Just add the following line into your .xinitrc or equivalent startup file:
browser-history &
Compilation is straigthforward. See Makefile, but normally, just typing
make is sufficient. It only uses Xlib and Xmu, not Xt. You must
just install the resulting binary "browser-history" somewhere in your
PATH. I tested it on linux, DEC alpha OSF/1, SGI, sun solaris 5.5, sun
sunos 4.1.3.
|
Tuesday 28 May 1996Colas's home page http://www.inria.fr/koala/colas/ 1996/05/28-08:38:34 0x6004a64 Jean-Michel's home page http://www.inria.fr/koala/jml/jml.html 1996/05/28-08:42:07 0x6004a64 phk's home page http://www.inria.fr/koala/phk.html 1996/05/28-10:22:32 0x6004a64 |
You can click on the listed URLs to go back to them, each entry is listed with the page name in bold, followed by the clickable URL, then the date and time you loaded it, and the X ID of the browser window.
An horizontal rule indicates that at least one hour separates two
entries. A file holds one week of history, past weeks are accessibles via
links at the top of the page.
browser-history logs in ~/.browser-history/history-log.html all the URLs you went through. You can then browse the log under Netscape or other browsers via the URL: file:~/.browser-history/history-log.html (replace the ~ by your home directory)
browser-history tracks automagically all already present browser windows, and all new ones created in the future. This program has no user interface. It just appends information to a log file in html format so you can browse it through a web browser. If more that one hour has passed since last entry, it draws an horizontal lines, and adds H1 headers to delimit new days. Each week (sunday mornings), it archives the week history, compresses it by gzip (that you must have in your path), and starts a new history with links to the older ones. To make room you can just remove the obsolete history files.
This version works with Netscape, Arena and Amaya.
URLs can be excluded from logging by putting them, one per line in the file ~/.browser-history/history-log.exclude. Then, if an URL begins with a line from this file, it is not logged. In this file, empty lines or lines beginning by # are comments This file is read once at startup, and re-read when receiving the signal 1. e.g:
# We exclude local files file: # Exclude search engines... http://home.netscape.com http://guide.infoseek.com
browser-history maintains a hidden window on the X display, whose ID is given by the property BROWSER_HISTORY on the root window. If this window is killed, it quits gracefully. On this sub-window the following properties are maintained:
You can customise the header of the newly created weekly log files by putting the header you want to use as an header.html file in the ~/browser-history directory. The default header is the first part of a newly generated file upto the line:
<!-- EndOfHeader -->
When browser-history is run, it looks if another one is running, and by default it kills the previous one if it is an older version. Otherwise, it the new one is the same version number or older, it just aborts.
All options can be given by their first letter: you can specify either -verbose or -v, but you cannot group options, e.g. you must say -v -k, but not -vk
where the following items are:
<b>name</b> <a href="URL">URL</a> yyyy/mm/dd-hh:mn:ss <small>windowid</small>
Just add on each browser window a string X property named BROWSER_HISTORY_INFO (and type XA_STRING) of the form (C printf string below):
"URL=%s\0TITLE=%s\0\0"where the first %s is the current URL, and the second the document name.
IMPORTANT! This property MUST be present and MUST contain some value BEFORE mapping (managing) the window, for browser-history to detect it. Otherwise, your browser windows will be ignored. If this proves too difficult for you, you can make the detection of your browser windows built-in in browser-history, search the string BT_AMAYA and add cases for your browser, and send me the patches.
Example from arena: each time a new URL is visited, it triggers this function on the window displaying the document at the same time as it updates the X window title by a call to XStoreName(dpy, win, title).
void SetXProperties( /* sets info for browser-history on each new URL */ Display *dpy, /* the X display */ Window win, /* the main document display window */ char *url, /* the URL being visited */ char *title) /* the <TITLE> of the document */ { static Atom property_name = 0; /* 13 is strlen("URL=0TITLE=00") */ int v_size = strlen(title) + strlen(url) + 13; char *v = (char *) malloc(v_size); /* or alloca, but dont call free */ sprintf(v, "URL=%s%cTITLE=%s%c", url, 0, title, 0); if (!property_name) property_name = XInternAtom(dpy, "BROWSER_HISTORY_INFO", False); XChangeProperty(dpy, win, property_name, XA_STRING, 8, PropModeReplace, v, v_size); free(v); }