Skip to content

Instantly share code, notes, and snippets.

@Icelys
Last active February 24, 2016 17:06
Show Gist options
  • Save Icelys/eef0ae1441226f0bbdd4 to your computer and use it in GitHub Desktop.
Save Icelys/eef0ae1441226f0bbdd4 to your computer and use it in GitHub Desktop.
Stops rickrolls
// ==UserScript==
// @name Anti-Rickroll
// @namespace icelys.github.io
// @version 1
// @grant none
// @match https://www.youtube.com/*
// ==/UserScript==
window.onload = function(){
if(document.location.toString().match(/http(|s):\/\/www\.youtube\.com\/watch/)!=null){
if(document.location.toString().match(/dQw4w9WgXcQ/ig) != null) {
//Video URL with video link in it
window.location = "http://icelys.github.io/files/Anti-Rickroll.html";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment