Skip to content

Instantly share code, notes, and snippets.

@RUJodan
Created September 11, 2014 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RUJodan/cac7a60d1fca0a97b406 to your computer and use it in GitHub Desktop.
Save RUJodan/cac7a60d1fca0a97b406 to your computer and use it in GitHub Desktop.
Rick Roll Link Detection
(function() {
[].forEach.call(document.getElementsByTagName('a'), function(x) {
x.addEventListener("mouseover", function() { warnABrotha(x) }, false);
});
})();
function warnABrotha(x) {
if (x.href == "http://www.youtube.com/watch?v=dQw4w9WgXcQ") alert("rick roll imminent");
}
/* to do: find a way to detect link shorteners */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment