Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop browsers storing history of a visit

I am currently developing a website for a women's refuge. As this is very sensitive information for those using the site I'd like to stop the browser from storing any history of their visit. Is this possible using something like the HTML5 History API? Ideally it would work in IE6+ too as there are a lot of people using old versions of IE.

I know browsers have Private Browsing modes, but most people don't know about them, so some automatic way would be best.

One potential (although less preferred) solution would be to prompt people to use Private Browsing mode if they aren't currently do so. Is it possible to detect this via JavaScript?

EDIT: I've accepted Virgil's answer as eduction is the best option as they may need to apply what they learnt to other sites too. I've also used Joseph's location.replace on the hide my visit button so it disables the back button.

One interesting thing to note is I tried using history.replace on all links on the site thinking this would replace all browser history meaning only the last page viewed was remembered. However opening the history panel in Firefox - not tested in other browsers - still showed a log of every page viewed, they were just inaccessible via the back button.

So, for anyone with a similar query, I'd like to reiterate that educating the user is the first step in protecting them. Thanks everyone for you advice.

Regards

Ric

like image 926
Ric Avatar asked Oct 25 '11 15:10

Ric


2 Answers

One way to do it is to make all navigation go exclusively through javascript using locarion.replace(url). This does not save a history state but also means the user could not really use bookmarks either. For a link, it would be similar to this

<a href="javascript:location.replace(location.host + '/wherever.html')" href="wherever.html">wherever</a>

Or

<a href="#" onclick="location.replace(location.host + 'wherever.html'); return false;">wherever</a>

or similar.

like image 44
Joseph Marikle Avatar answered Sep 19 '22 15:09

Joseph Marikle


Unfortunately this is not possible. User action would have to be taken to delete their history. I suggest you put up a warning so women can delete their history and you can include instructions for every major browser. In regards to HTML5 and JavaScript this would not be possible in IE6 as it doesn't support HTML5.

like image 98
Virgil Shelton Avatar answered Sep 19 '22 15:09

Virgil Shelton