Utwente Cleaner

Remove unessecary elements from the webpage

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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();
    });
}