Twitch.TV Background-B-Gone

Removes channel backgrounds only.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Twitch.TV Background-B-Gone
// @version    0.9
// @description Removes channel backgrounds only.
// @include        http://*.twitch.tv/*
// @include        http://twitch.tv/*
// @exclude        http://www.twitch.tv/directory*
// @exclude        http://www.twitch.tv/inbox*
// @exclude        http://www.twitch.tv/subscriptions*
// @exclude        http://store.twitch.tv
// @exclude        http://api.twitch.tv/*
// @exclude        https://api.twitch.tv/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @require     http://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.0/jquery.cookie.min.js
// @grant       GM_addStyle
// @namespace https://greasyfork.org/users/59
// ==/UserScript==

var showCheck1 = 0;
var zNode1       = document.createElement ('div');

zNode1.innerHTML = '<button id="myButton1" type="button">'
                + 'B</button>';

zNode1.setAttribute ('id', 'myContainer1');
document.body.appendChild (zNode1);

//--- Activate the newly added button.
document.getElementById ("myButton1").addEventListener (
    "click", ButtonClickAction, false
);

function ButtonClickAction (zEvent) {

if(showCheck1 == 1) {
$('canvas:nth-of-type(1)').fadeIn("fast");
$("#myButton1").fadeTo("fast", 1).delay(200).css({"color":"white"});
    showCheck1 = 0;
    $.cookie("check", 1, { expires: 7, path: "/" });
}
else if(showCheck1 == 0) {
$('canvas:nth-of-type(1)').fadeOut("fast");
$("#myButton1").fadeTo("fast", 0.5).delay(200).css({"color":"yellow"});
        showCheck1 = 1;
    $.cookie("check", 2, { expires: 7, path: "/" });
}
else {
    
}
       
}

//--- Cookie Check

if($.cookie("check") == 1) {
$('canvas:nth-of-type(1)').fadeIn("fast");
$("#myButton1").fadeTo("fast", 1).delay(200).css({"color":"white"});
    showCheck1 = 0;
}
else if($.cookie("check") == 2) {
$('canvas:nth-of-type(1)').fadeOut("fast");
$("#myButton1").fadeTo("fast", 0.5).delay(200).css({"color":"yellow"});
        showCheck1 = 1;
}
else {
    
}

//--- Style our newly added elements using CSS.
GM_addStyle ( multilineStr ( function () {/*!
    #myContainer1 {
        position:               absolute;
        top:                    0;
        left:	 0;
        font-size:              1px;
        border:                 0px outset black;
        margin:                 2px;
        opacity:                10.0;
        z-index:                222;
        padding:                1px 1px;
    }
    #myButton1 {
        cursor:                 pointer;
       	background: 			transparent;
    	border: 				none !important;
        color:					white;
    }
    #myContainer1 p {
        color:                  purple;
        background:             white;
    }
*/} ) );

function multilineStr (dummyFunc) {
    var str = dummyFunc.toString ();
    str     = str.replace (/^[^\/]+\/\*!?/, '') // Strip function () { /*!
            .replace (/\s*\*\/\s*\}\s*$/, '')   // Strip */ }
            .replace (/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them.
            ;
    return str;
}