CNBeta首页广告隐藏

通过css隐藏首页滚动时加载的广告

目前為 2018-12-06 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         CNBeta首页广告隐藏
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  通过css隐藏首页滚动时加载的广告
// @author       woodj
// @license      MIT
// @include        *://www.cnbeta.com*
// @icon           https://www.cnbeta.com/images/logo_1.png
// @require     https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.js
// ==/UserScript==

(function () {
    'use strict';
    // 创建 <style> 标签
    var style = document.createElement("style");
    // 对WebKit hack :(
    style.appendChild(document.createTextNode(".trc_related_container { display: none; }"));
    // 将 <style> 元素加到页面中
    document.head.appendChild(style);
    setInterval(function() {
        $(".adsbygoogle").css("display", "none");
    }, 500);
})();