Skip to content

Instantly share code, notes, and snippets.

@zhantongz
Last active August 29, 2015 13:56
Show Gist options
  • Save zhantongz/9310701 to your computer and use it in GitHub Desktop.
Save zhantongz/9310701 to your computer and use it in GitHub Desktop.
A simple JS to determine if a user is restricted by GFW with jQuery
var icon = "http://s.ytimg.com/yts/img/favicon-vfldLzJxy.ico";
var locationWall = (! $('<img src="'+ icon +'">').load()); // false if out of Mainland; true otherwise
if(locationWall)
{
console.log("You are restricted by the Wall.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment