Greasy Fork

Greasy Fork is available in English.

Twitch fulltitle and no cheerpin

Shows the fulltitle on twitch and removes the pin for cheers on top of the stream

目前为 2018-03-01 提交的版本,查看 最新版本

// ==UserScript==
// @name         Twitch fulltitle and no cheerpin
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Shows the fulltitle on twitch and removes the pin for cheers on top of the stream
// @author       Bobocato
// @match        https://www.twitch.tv/*
// @grant        none
// ==/UserScript==

/*
Taken from https://stackoverflow.com/questions/9153718/change-the-style-of-an-entire-css-class-using-javascript/14249194#14249194
*/

function cssrules(){
    var rules={}; var ds=document.styleSheets,dsl=ds.length;
    for (var i=0;i<dsl;++i){
        var dsi=ds[i].cssRules,dsil=dsi.length;
        for (var j=0;j<dsil;++j) rules[dsi[j].selectorText]=dsi[j];
    }
    return rules;
}
function css_getclass(name,createifnotfound){
    var rules=cssrules();
    if (!rules.hasOwnProperty(name)) throw 'todo:deal_with_notfound_case';
    return rules[name];
}

(function() {
    'use strict';
    css_getclass(".tw-ellipsis").style.textOverflow = "initial";
    css_getclass(".tw-ellipsis").style.whiteSpace = "initial";
    css_getclass("pinned-cheer-v2").style.display = "none";
})();