Created
September 11, 2014 19:07
-
-
Save RUJodan/cac7a60d1fca0a97b406 to your computer and use it in GitHub Desktop.
Rick Roll Link Detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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