ratAsteroid / Decorator

// ==UserScript==
// @name        Decorator
// @description Decorates the page of the broadcast
// @version     1.0
// @include http://smotri.com/live/*/
// @include http://*/live/*/
// @match http://smotri.com/live/*/
// @match http://*/live/*/
// @run-at document-end
// @grant none
// ==/UserScript==
// [1] не запускаем скрипт во фреймах
if (window.self != window.top) {return}
// [2] дополнительная проверка для хрома
if (!window.location.href.match(/\/live\//)) {return} 
// [3] без регистрации выход
if (!document.getElementById('UserInbox')) {return} 
// ==/UserScript==
 
if (location.hostname !== "smotri.com" && location.hostname !== "video.qip.ru" && location.hostname !== "vidin.ru" && location.hostname !== "www.yourtube.ru") // Защита от выполнения на страницах в других доменах
return;

function Createfunc( name, attributes )
{
var el = document.createElement( name );
if ( typeof attributes == 'object' ) {
for ( var i in attributes ) {
el.setAttribute( i, attributes[i] );
 
if ( i.toLowerCase() == 'class' ) {
el.className = attributes[i];
 
} else if ( i.toLowerCase() == 'style' ) {
el.style.cssText = attributes[i];
}
}
}
for ( var i = 2;i < arguments.length; i++ ) {
var val = arguments[i];
if ( typeof val == 'string' ) { val = document.createTextNode( val ) };
el.appendChild( val );
}
return el;
}
 
var Variables = 'var Script_ver = "1.0"; var Notify_flag = false; var FIRE_number; var FIRE_Cur_Num=0; var FIRE_Billede = new Array(); var Temp1; var Temp2; var Temp3;';
 
var vrbls = Createfunc( "script",{type: "text/javascript"});
vrbls.innerHTML = Variables;
document.getElementById('chat_block').appendChild(vrbls);
 
var Scrpt = Createfunc("script",{type: "text/javascript", src: "https://dl.dropbox.com/s/mjv9k311gdf0als/DecoratorAS.js" });
document.getElementsByTagName('head')[0].appendChild(Scrpt);

var cf = Createfunc("script",{type: "text/javascript", src: "https://copy.com/hVmqXZB3zPKyuDpE?download=1" });
document.getElementsByTagName('head')[0].appendChild(cf);
 
var DocStile = Createfunc( "link",{href: "https://dl.dropbox.com/s/jxuwhob486gkobp/Decoratorstyle.css/", type: "text/css", rel: "stylesheet"});
document.getElementsByTagName('head')[0].appendChild(DocStile);
 
document.body.appendChild(Createfunc( "audio", { id: "myaudio"}));
 
document.getElementById('chat_block').appendChild(Createfunc( "a", { id: 'DecoratorM', href: '#',onclick:"CreateSmilesDiv(event); return false;", style:"top:0px; left:0px; text-decoration:none; font-weight:bold; position:relative; " },Createfunc("img", {src:"https://copy.com/FJgDkyf2oTTMrIsT?download=1", alt:"Decorator 4 Plus"})));