Utwente Cleaner

Remove unessecary elements from the webpage

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Utwente Cleaner
// @namespace    Ass
// @version      0.3
// @description  Remove unessecary elements from the webpage
// @author       You
// @match        http://websdr.ewi.utwente.nl:8901/
// @run-at       document-start
// @grant        none
// ==/UserScript==
//var newStyle = "<style>#maincontrols { float:left; } #feedControls{white-space:nowrap;float: left;width: 325px;} #feedControls > div { display: block;box-sizing: border-box;margin: 0;}</style>";
var newStyle = "<style>#feedControls{ white-space:nowrap;width: 100%;background: white;height: 121px;} #feedControls > div { display: block;box-sizing: border-box;margin: 0; float:left; height:121px;}</style>";

Element.prototype.remove = function() {
    this.parentElement.removeChild(this);
};
NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
    for(var i = this.length - 1; i >= 0; i--) {
        if(this[i] && this[i].parentElement) {
            this[i].parentElement.removeChild(this[i]);
        }
    }
};
document.onreadystatechange = function(e)
{
    if (document.readyState === 'complete')
    {
        setupElements();
        (document.head || document.documentElement).insertAdjacentHTML('beforeend',newStyle);
        
        document.body.innerHTML = (
            function(){ 
                var html = "";
                document.querySelectorAll("script").forEach(function(a){ html += a.outerHTML; });
                document.querySelectorAll("style").forEach(function(a){ html += a.outerHTML; });
                document.querySelectorAll("div.mainspan").forEach(function(a){ html += a.outerHTML; });
                return html;
            }
        )();
    }
};
function setupElements(){
    var feedControls = document.querySelector('div[style="white-space:nowrap;"');
    feedControls.id = "feedControls";
    feedControls.querySelectorAll(":scope > .ctl").forEach(function(ctl){
       
    });
    document.querySelectorAll("br").forEach(function(a){
        console.log(a.parentElement.classList);
        if(!a.parentElement.classList.contains("ctl"))
            a.remove();
    });
}