Skip to content

Instantly share code, notes, and snippets.

@piks
Last active August 29, 2015 14:25
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 piks/fe764387b85fa2bb6872 to your computer and use it in GitHub Desktop.
Save piks/fe764387b85fa2bb6872 to your computer and use it in GitHub Desktop.
redirect chatango to html5 or flash
// ==UserScript==
// @name chatango redirect
// @namespace 2pichubros_chatango
// @description redirects to html or flash automatically
// @include /(http|https):\/\/.*?\.chatango.com\/$/
// @version 2
// @grant none
// ==/UserScript==
blacklist = []; //Add users/chats that you would not like to have redirected here
url = window.location.href;
user = url.split(".")[0].split("://")[1]
mode = "html5"; //set to either html5 or flash depending on what you want to redirect to
if (blacklist.indexOf(user) >= 0){
console.log("redirect in blacklist... passing")
return "Blocked"
}
else{
if (mode == "html5"){
mode = "?js"
}
else if (mode == "flash"){
mode = "?flash"
}
window.location.href = window.location.href+mode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment