Long time ago I made a proxy service that did that (2004 or so). The idea was that it logged everything you visited and then you could search your own logs. I used it for a few years but sadly nobody else really did. I think I actually wrote it in C of all things.
It optionally worked in combination with a browser plugin that did a tree view that showed a true navigation history (one site could have many children). So you could find the site and the context and the time you saw it and trace back the multi-path journey you took.
I have no idea where the code is. Probably some old cvs repo somewhere.
Wouldn't be of much use now since everything is https. Back then my inability to log https was the "method" to make sure that I didn't log anything sensitive such as banking details because only that stuff was in https at the time.