Greasy Fork

Greasy Fork is available in English.

精简爱词霸

去除爱词霸的广告和所有非必要元素。

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

// ==UserScript==
// @name         精简爱词霸
// @namespace    http://greasyfork.icu/users/481318
// @version      0.1
// @description  去除爱词霸的广告和所有非必要元素。
// @author       Crexyer
// @match        *://www.iciba.com/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @require      https://cdn.jsdelivr.net/npm/js-cookie@rc/dist/js.cookie.min.js
// @grant        none
// ==/UserScript==

/* globals $, Cookies */

(function() {
    $("html").css("overflow-y", "auto");

    $(".goto-top").css({
        "left": "auto",
        "right": "5%",
        "bottom": "5%",
        "margin-left": "auto"
    });

    $(".search-bar").css("width", "calc(100% - 20px)");
    $(".search-input").css("width", "calc(100% - 117px)");
    $(".search-history").css({
        "width": "calc(100% - 40px)",
        "padding-left": "20px",
        "padding-right": "20px"
    });
    $(".search-clear").css("width", "48px");

    $(".container-left").css("width", "100%");
    $(".container").css({
        "width": "calc(100% - 20px)",
        "min-height": "auto",
        "padding-bottom": "0",
        "padding-left": "10px",
        "padding-right": "10px"
    });

    $(".in-base-top").css("width", "100%");
    $(".base-list p").css("width", "100%");
    $(".in-base-top > h1").css({
        "width": "100%",
        "word-wrap" : "break-word"
    });
    $(".in-base-top > div").css({
        "width": "100%",
        "word-wrap" : "break-word"
    });

    $(".common-top").css("display", "none");
    $(".search-line").css("display", "none");
    $(".search-hot").css("display", "none");
    $(".container-right").css("display", "none");
    $(".menu").css("display", "none");
    $(".cb-downloadbar").css("display", "none");
    $(".foot-top-seo").css("display", "none");
    $(".foot").css("display", "none");

    $(window).on('load', function() {
        $(".info-product").removeAttr("style").css("display", "none");
        $(".info-hotwords").removeAttr("style").css("display", "none");

        // 禁用划词功能
        window.ICIBA_HUAYI_ALLOW = 0;
        Cookies.set("search-menu-button-status", 0);

        // 去除广告
        $(".search-ad").css("display", "none");
        $(".ad-left").css("display", "none");
    });
})();