FiNEk / wide-twitch-clips

Browser extension that removes useless empty space around twitch player.
0 stars 0 forks source link

Userscript #1

Closed camjac251 closed 4 years ago

camjac251 commented 5 years ago

I converted your extension into a userscript. It might be easier for those who don't use chrome or to enable the developer mode

// ==UserScript==
// @name         Wide Twitch Clips
// @namespace    https://github.com/FiNEk/wide-twitch-clips
// @version      1
// @description  Full Page Twitch Clips Player
// @author       FiNEk
// @match        *://clips.twitch.tv/*
// @grant        none
// ==/UserScript==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

(function() {
    addGlobalStyle('.clips-watch {margin-top: 2rem;min-width: 100%!important;}');
    addGlobalStyle('.clips-sidebar {height: 45vw!important;}');
    addGlobalStyle('.clips-top-nav {display: none;}');
    addGlobalStyle('#root > div > div {padding-top: 0!important;}');
    addGlobalStyle('#root > div > div > div > div.simplebar-scroll-content > div > div > main > div > div > div.tw-align-items-center.tw-flex.tw-justify-content-end.tw-mg-y-1.tw-relative.tw-z-above {display: none!important;}');
})();
FiNEk commented 5 years ago

This is awesome! I even went ahead and published that on userscripts hub if you dont mind. openuserjs.org/scripts/efOne/Wide_Twitch_Clips. If you have an account there i can mark you as collaborator, that way you will get editing permissions if you want to.