chatango redirect

redirects to html or flash automatically

当前为 2015-07-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name chatango redirect
  3. // @namespace 2pichubros_chatango
  4. // @description redirects to html or flash automatically
  5. // @include /(http|https):\/\/.*?\.chatango.com\/$/
  6. // @version 2
  7. // @grant none
  8. // ==/UserScript==
  9. blacklist = []; //Add users/chats that you would not like to have redirected here
  10. url = window.location.href;
  11. user = url.split(".")[0].split("://")[1]
  12. mode = "html5"; //set to either html5 or flash depending on what you want to redirect to
  13. if (blacklist.indexOf(user) >= 0){
  14. console.log("redirect in blacklist... passing")
  15. return "Blocked"
  16. }
  17. else{
  18. if (mode == "html5"){
  19. mode = "?js"
  20. }
  21. else if (mode == "flash"){
  22. mode = "?flash"
  23. }
  24. window.location.href = window.location.href+mode;
  25. }