Greasy Fork

Greasy Fork is available in English.

洛谷广告屏蔽

屏蔽洛谷的广告

目前为 2020-08-03 提交的版本,查看 最新版本

// ==UserScript==
// @name         洛谷广告屏蔽
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  屏蔽洛谷的广告
// @author       songhongyi
// @match        https://www.luogu.com.cn/problem/*
// @match        https://www.luogu.com.cn/contest/*
// @match        https://www.luogu.com.cn/training/*
// @grant        unsafeWindow
// ==/UserScript==

(function() {
    'use strict';
    var document=unsafeWindow.document;
    window.onload=function(){setTimeout(function()
    {
        var buttons =document.getElementsByClassName("lfe-form-sz-small")[0];
        if (buttons)
        {
            buttons.click();
            console.log("广告已经消除");
        }
    },500)}
    // Your code here...
})();