Twitch.TV Background-B-Gone

Removes channel backgrounds only.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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;
}