paint-brush
Exploring Hidden Navigation for Domestic Violence Sitesby@bob.js
158 reads

Exploring Hidden Navigation for Domestic Violence Sites

by Bob FornalDecember 13th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The concept was inspired by a Survivor of Domestic Violence survivor. The idea was to hide the actual traffic from the browser's history. The code is a bit hacky, but it works, but is powerful and worthy of some exploration. It is not a wild amount of code for an open-source project, but what it is doing is powerful. The solution is based on the NPM project - Tiny-Anchor - and the GitHub Repo - and it is available on GitHub.

Company Mentioned

Mention Thumbnail
featured image - Exploring Hidden Navigation for Domestic Violence Sites
Bob Fornal HackerNoon profile picture

Recently, I had the incredible honor to work with an individual who was a Survivor of Domestic Violence. This was all part of a business "hackathon."

Setting aside the ideas that came out and amazing projects that I got to see, there was one concept that had me intrigued.

The Project

Hiding Navigation

Assuming that the people visiting the site are in some dangerous scenario, I wanted to know if the actual traffic can be hidden. Here, I was thinking of minimizing the cached files and browser history.

The first thing I looked into was disabling the cache.

Checking with a co-worker, I found that not caching files is easy, but we had to be careful of utilizing CDNs ... their content would be seen, regardless of how our server handled caching.

Next, I wanted to see if I could minimize the site's "footprint" ... which I am describing as seeing the pages viewed in the browser's history.

After a lot of research here ... I found almost no good results.

There is no easy way to clear browser history while leaving or after having left a site. I did come up with a somewhat reasonable solution. It's a bit of a hack and depends on the user to navigate within the site (not using the address bar, bookmarks, or back and forward options.

The Solution

What I came up with feels a bit hacky, but it does work.

navigate(event, location) {
  event.preventDefault();
  window.location.replace(location);
  return false;
}

What is happening here is that the

location
is being replaced. This minimizes the number of times our site is listed in the history. And, if this pattern is used to leave the site, the new address overwrites the old one ... and our site is gone from the browser history.

With a navigate like this, anchors can be adjusted, as follows.

<a href="#" onclick="anchor.navigate(event, 'index.html')">Home</a>
<a href="#" onclick="anchor.navigate(event, `http://www.google.com`)">Off-Site</a>

Basically, the code replaced the last cached link in the browser's history, ensuring that the site is only seen once.

Again, if the user navigates off the site using a link setup like the second one above, there is no reference to the site in the browser's history.

Conclusion

While this is not a wild amount of code for an open-source project, what it is doing is powerful and worthy of some exploration.

Here is the NPM project, the example site, and the GitHub Repo.

My hope is that this code allows for additional safety and potentially inspires other code along the same lines.