blickCleaner

try to take over the world!

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         blickCleaner
// @namespace    org.free.world
// @version      0.0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.blick.ch/*
// @grant        none
// @noframes
// ==/UserScript==

(function() {
    'use strict';
    window.onload = function () {

        var targetNode = document.getElementsByTagName("body")[0];
        var targetNode2 = document.getElementsByTagName("html")[0];
        var config = { attributes: true, childList: true, subtree: true };

        var callback = function(mutationsList, observer) {
            for(var mutation of mutationsList) {
                if (mutation.type == 'childList') {
                    console.log('A child node has been added or removed.');
                    removeCrap(targetNode, targetNode2);
                }
                else if (mutation.type == 'attributes') {
                    console.log('The ' + mutation.attributeName + ' attribute was modified.');
                    //removeCrap();
                }
            }
        };

        var observer = new MutationObserver(callback);
        observer.observe(targetNode, config);
    };

    function removeCrap(targetNode, targetNode2 )
    {
        targetNode.style.height = "";
        targetNode.style.overflowY = "scroll";
        targetNode2.style = "";

        // maybe they change their prefix "sp_" then you have to change it below

        var nodesToRemove = document.querySelector('[id^="sp_"]');
        if(nodesToRemove !== null)
        {
            nodesToRemove.parentNode.removeChild(nodesToRemove);
        }
        var nodesToRemove2 = document.querySelector('[class^="sp_"]');
        if(nodesToRemove2 !== null)
        {
            nodesToRemove2.parentNode.removeChild(nodesToRemove2);
        }

    }

})();