Skip to content
Block people by IP address, city, or proxy, in JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore updated readme Jul 15, 2013
stalker.min.js added ip whitelist feature Jul 15, 2013


If someone is stalking you on your website, here's what you do. This method is all in JavaScript so it works on Tumblr. Of course.. that means that for a stalker to get around it, they can just disable JavaScript in their browser. To prevent that, hide the <body> element with CSS, and show that element when JavaScript is loaded.

How to block people on Tumblr

Click "Edit HTML" in the theme customizer. Paste this code after the <head> tag:

<!-- js-stalker code -- -->
// Configure the blocker here:
var stalker = {
  forward: '!!!!',
  ip_addresses: [''],
  whitelist_ip_addresses: [''],
  cities: ['Seattle', 'Olympia'],
  states: ['OR'],
  proxies: true

<script src="//"></script>
// stalker.js
function proxyBlock(a){document.URL!=stalker.forward&&"Y"==a.proxy&&(window.location=stalker.forward)}
function jsStalkerGet(a){document.URL==stalker.forward||(-1==stalker.ip_addresses.indexOf(a.geoplugin_request)&&-1==stalker.cities.indexOf(a.geoplugin_city)&&-1==stalker.states.indexOf(a.geoplugin_region)||-1!=stalker.whitelist_ip_addresses.indexOf(a.geoplugin_request))||(window.location=stalker.forward);stalker.proxies&&$.ajax({url:"",type:"GET",data:{ip:a.geoplugin_request,format:"jsonp"},crossDomain:!0,dataType:"jsonp",jsonp:"cb",jsonpCallback:"proxyBlock"})}
<script src="" type="application/javascript"></script>
<!-- end js-stalker -->

If you want to still see who gets caught in the blocker in your StatCounter, make sure the StatCounter code is before the js-stalker code.


Specify the site to forward stalkers to

var stalker = { forward: '!!!!' };

Block their house

If you want to block them from going to your site at their house, find their IP address with StatCounter -

var stalker = { ip_addresses: [''] };

Allow certain IP's to get through by putting them in the whitelist:

var stalker = { whitelist_ip_addresses: [''] };

Block their city

To block anyone in Seattle or Olympia:

var stalker = { cities: ['Seattle', 'Olympia'] };

Block anonymous proxies

js-stalker can block users that are suspected of using an anonymous proxy like Tor or

var stalker = { proxies: true };
You can’t perform that action at this time.