GY Soil Element Remover

remove soil elements

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         GY Soil Element Remover
// @version      0.1
// @description  remove soil elements
// @author       XMAnon
// @match        *://music.163.com/*
// @grant        none
// @namespace https://greasyfork.org/users/666548
// ==/UserScript==

(function() {
    'use strict';

    //var getDoku = document;
    var realDoku = '';
    if (!document) {//document nodes  not found
        console.warn("Iframe exist!?");
        realDoku = document.querySelector('#g_iframe').contentDocument;//.querySelectorAll("div[class='soil']");
        if (!realDoku) {
            console.warn("No doku found!! ");//should be impossible
            return;
        }
    }
    else{
        realDoku = document;
        if (!realDoku) {
            console.warn("No doku found!! ");//should be impossible
            return;
        }
    }
    var soilNodes = realDoku.querySelectorAll("div[class='soil']");
    if (!soilNodes) {
        console.log("No soil found! Nice! ");
        return;
    }
    for (var i = 0; i < soilNodes.length; i += 1) {
        soilNodes[i].remove();
    }
})();