javascript - Stop browsers storing history of a visit - Stack Overflow

I am currently developing a website for a women's refuge. As this is very sensitive information fo

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

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

Share Improve this question edited Oct 26, 2011 at 9:24 Ric asked Oct 25, 2011 at 15:59 RicRic 3,4881 gold badge35 silver badges52 bronze badges 4
  • 1 Useful: stackoverflow./questions/2860879/… – Konerak Commented Oct 25, 2011 at 16:02
  • Good thinking, and good luck on your great cause! – Niklas Wulff Commented Oct 25, 2011 at 16:07
  • one solution is to have certain helpful innocuous partners load your page up AJAX style, or by proxy, etc, that makes it impossible for a second user to revisit. Maybe make a one time link that directs to your site via proxy, then have that one time link be destroyed or pointed elsewhere. – Lee Louviere Commented Oct 25, 2011 at 16:08
  • Thanks, I had a look at the link. Interesting stuff there. @Niklas, thank you! – Ric Commented Oct 26, 2011 at 7:45
Add a ment  | 

4 Answers 4

Reset to default 3

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.

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.

Well, though I don't think you can "force" users to use private browsing, you can give them every opportunity to avoid the history.

For example, have the site attempt to store a cookie (both from the server and using a language like javascript). If the server can then re-detect the cookie on the next visit, redirect them to a "Use private browsing [and here's how] or proceed at your own risk" kind of landing page.

That about the only way around it.

I, of course, would also implement SSL, but I think this is more implied.

Wouldn't the solution be to use HTTPS? I am pretty sure browsers don't store the history for those sites.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745099903a4611211.html

相关推荐

  • javascript - Stop browsers storing history of a visit - Stack Overflow

    I am currently developing a website for a women's refuge. As this is very sensitive information fo

    15小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信