Shadow19

Google Domain Origin Fix (YouTube Player Fix) for FF + NoScr

Mar 18th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Google Domain Origin Fix (YouTube Player Fix) for FF + NoScript Users on Xat
  3. // @namespace   GDOF(YPF)
  4. // @include     *//xat.com/*
  5. // @include     *//xat.me/*
  6. // @include     *//chatsgroup.com/web_gear/chat/media.php?d=*
  7. // @version     1
  8. // ==/UserScript==
  9.  
  10. window.onload = function(){
  11.   setInterval(function(){
  12.     elements = document.getElementsByTagName("embed");
  13.     for(element of elements){
  14.       if(element.src)
  15.         if(element.src.indexOf("youtube.googleapis.com") != -1 || element.src.indexOf("youtube.com") != -1)
  16.           if(element.src.substr(0, 2) == "//" || element.src.substr(0, 7) == "http://")
  17.             element.src = "https://" + element.src.split("//",2)[1];
  18.     }
  19.   },1000);
  20. }
Add Comment
Please, Sign In to add comment