Skip to content

Instantly share code, notes, and snippets.

@james-see
Created February 2, 2017 21:52
Show Gist options
  • Select an option

  • Save james-see/e1776480f12af1db403da509f5528466 to your computer and use it in GitHub Desktop.

Select an option

Save james-see/e1776480f12af1db403da509f5528466 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
var onion = 'https://dua6u3dsufohrnsz.onion';
var query = new XMLHttpRequest();
if (window.location.protocol + "//" + window.location.hostname != onion) {
query.onload = function(e) {
if (query.status != 200) return
else {
window.location.assign(onion + window.location.pathname);
}
};
query.timeout = 5000;
query.open('HEAD', onion, true);
query.send();
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment