Greasy Fork

Greasy Fork is available in English.

9酷

9酷歌曲广告剔除

当前为 2021-08-04 提交的版本,查看 最新版本

// ==UserScript==
// @name         9酷
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  9酷歌曲广告剔除
// @author       gwbc
// @match        https://www.9ku.com/*
// @icon         https://scpic.chinaz.net/Files/pic/icons128/8169/e12.png
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
    document.querySelector('div.youFix').remove();
    var iframes = document.querySelectorAll('iframe');
    for (var i = 0; i < iframes.length; ++i) {
        iframes[i].remove();
    }

    var boxWidth = document.querySelector('.box').getBoundingClientRect().width;
    var boxHeight = document.querySelector('.nplayL-box').getBoundingClientRect().height
    document.querySelector('.pFl.clearfix').style.width = boxWidth + "px";
    document.querySelector('.nplayL-box').style.width = boxWidth / 2 + "px";
    document.querySelector('.ppR').style.width = boxWidth / 2 + "px";
    document.querySelector('.playingTit').style.width = boxWidth / 2 - 22 + "px";
    document.querySelector('.oldPlayer').style.margin = 0;
    document.querySelector('.lrcBox').style.width = boxWidth / 2 - 2 + "px";
    document.querySelector('.lrcBox').style.height = boxHeight - 111 + "px";
    document.querySelector('.oldPlayer').style.width = boxWidth / 2 - 22 + "px";
    document.querySelector('.ncol-btns').remove();
    document.querySelector('.dongBox.mb10').remove();
    document.querySelector('#p_top').remove();
    document.querySelector('.fotter').remove();
    document.querySelector('.ppBox').style.height = boxHeight - 2 + "px";
    document.querySelector('.ppBox').style.borderBottom = "1px solid #259b24";
    document.querySelector('.jp-progress').style.width = boxWidth / 2 - 20 + "px";
    document.querySelector('#lyric').style.height = boxHeight - 100 + "px";

    var count = 0
    var t = setInterval(function() {
        count++;
        if (count > 2000) {
            clearInterval(t);
        }

        try {
            var iframes = document.querySelectorAll('iframe');
            for (var i = 0; i < iframes.length; ++i) {
                iframes[i].remove();
            }

            var sprris = document.querySelectorAll('#songlist li');
            for (i = 0; i < sprris.length; ++i) {
                if (sprris[i].id.length != 0) {
                    sprris[i].remove();
                }
            }

            document.querySelector('.box.bgWrite.mb10.clearfix').remove();
            document.querySelector('.xxl.clearfix').remove();
            document.querySelector('.box.bgWrite.mb10').remove();
            document.querySelector('#fankui').remove();
            document.querySelector('#weixin').remove();
            document.querySelector('#gotop').remove();
        } catch (e) {

        }
    }, 1);

})();