移除cnBeta文章底部的红框和弹窗

移除cnBeta文章底部的反adblock红框, 移除弹窗

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         移除cnBeta文章底部的红框和弹窗
// @namespace    http://tampermonkey.net/
// @version      0.73
// @description  移除cnBeta文章底部的反adblock红框, 移除弹窗
// @author       You
// @match        https://*.cnbeta.com/*
// @match        https://*.cnbeta.com.tw/*
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @grant        none
// ==/UserScript==

!function(){"use strict";
    $("#abd-ad-iframe-wrapper").remove();
    var e=0;e=setInterval(function(){
        let t,a=!1;0!==(t=$("a[href='//www.cnbeta.com/articles/3.htm']").parents().eq(2)).length&&(t.remove(),a=!0),a&&(clearInterval(e),$("body").css("padding-bottom","0"))
    },100);//I can't remember what is the original code
    //Then create another setInterval to make the function working
    var t=0;
    t=setInterval(function () {
        if ( $('.fc-ab-root i.fc-close-icon').length != 0 ) {
            $('.fc-ab-root i.fc-close-icon').click();
            var clicked = true;
        }
        if ( $('.fc-ab-root').length == 0 && clicked ) { // make the code easy to read for all people
            clearInterval(t);
        }
    }, 100);
}();