Greasy Fork

Greasy Fork is available in English.

驱动之家净化阅读 - 文章样式调整

驱动之家阅读文章样式调整

当前为 2023-12-27 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         驱动之家净化阅读 - 文章样式调整
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  驱动之家阅读文章样式调整
// @author       zengyufei
// @match        http://www.mydrivers.com/
// @match        https://www.mydrivers.com/
// @match        https://news.mydrivers.com/
// @match        http://news.mydrivers.com/
// @match        https://news.mydrivers.com/class/**
// @match        http://news.mydrivers.com/**.htm
// @match        https://news.mydrivers.com/**.htm
// @grant        none
// @require      http://code.jquery.com/jquery-1.11.0.min.js
// ==/UserScript==

if ('loading' == document.readyState) {
    console.log("此脚本在文档启动时运行。");
    $("script").remove()
} else {
    console.log("此脚本与document.readyState一起运行:" + document.readyState);
    $("script").remove()
}
document.addEventListener('readystatechange', event => {
    $("script").remove()
    if (event.target.readyState === 'loading') {
        $("script").remove()
        console.log("此脚本在文档启动时运行1。");
    }
    if (event.target.readyState === 'interactive') {
        $("script").remove()
        console.log("此脚本在文档启动时运行2。");
    } else if (event.target.readyState === 'complete') {
        $("script").remove()
        console.log("此脚本在文档启动时运行3。");
    }
});
(function () {
    $("script").remove()
    console.log("此脚本开始运行。");
    'use strict';

    var isContentPage = /.*htm$/.test(location.href) &&  /^http(s)?:\/\/news\.mydrivers\.com\/.*$/.test(location.href)
    var isIndexPage = /^http(s)?:\/\/www\.mydrivers\.com\/$/.test(location.href)
    var isZhiBo = $(".zhibo_box").length > 0


    if(isZhiBo) {

    } else if (isContentPage) {

        $(".main_left").attr("style", "width:1250px !important;margin:0 auto;float:none;height: auto;");
        $(".news_info1").attr("style", "background: #fff;");
        $(".main_1").removeAttr("style");
        $(".main_1").attr("style", "height:1099px;");


        $("script").remove()
        $(".news_info>div").remove();
        $("#i_lastnext").remove();
        $(".pathway").remove();
        $(".baidu").remove();

        $(".news_n").nextAll().not("#commentsiframe").remove();

        $(".top").remove();
        $(".weixin").remove();
        $(".news_xg").remove();
        $(".main_right").remove();
        $("#right_tab").remove();
        //$("iframe").remove();
        $("body link").remove();
        $("body style").remove();


        $("#dummybodyid .news_box").attr("style", "width:1333px;");
        $("#dummybodyid .news_box .news_left").attr("style", "width:1333px;");

        $(".news_n").attr("style", "width:1230px;");
        $(".pinlun_input").attr("style", "width:1230px;");
        $(".plun_left_newplun").attr("style", "width:1230px;");
        $("#commentsiframe").attr("style", "width:92%;");
        $(".share table").attr("style", "width:85%;");
        $("#a_showhotnews_list_dia").remove();

        $("#dangbei_down").parent().remove();
        $(".news_bt1").remove();
        $(".zcdf").remove();
        $(".share").remove();
        //$("#commentsiframe").remove();
        $("#footer").remove();
        $("div.news_box  div.news_right").remove();

        var newsLeft = $(".news_left");
        var commentsiframe = $("#commentsiframe");
        newsLeft.css("width", "1333px")



    } else {
        if (isIndexPage) {

            $(".main_left").attr("style", "width:1050px !important;margin:0 auto;float:none;height: auto;background:#fff0;");
            $(".news_info1").attr("style", "background: #fff;");
            $(".main_1").removeAttr("style");
            $(".main_1").attr("style", "height:1099px;");

            var shidianDom = $(".shidian")
            shidianDom.remove();

            $(".main_box").remove();
            var gcDom = $("#GC_box")
            gcDom.nextAll().remove();
            gcDom.remove();

            $("iframe").remove();
            $("body link").remove();
            $("body style").remove();

            $(".main_2").remove();

            $(".nav_box").remove();
            $(".main_right").remove();
            $(".main_right_title").remove();
            $(".main").attr("style", "width:1333px;");
            $("#news_content_1,#news_content_2,#news_content_3,#news_content_4,#news_content_5").after(
                '<HR style="FILTER: alpha(opacity=100,finishopacity=0,style=3)" width="80%" color=#987cb9 SIZE=1>'
            ).show()
            $("#news_content_page").remove();
        } else {
            $(".shidian").remove();
            $(".product_box").remove();
            $(".righttitle ").remove();
            $(".top_1_center ").remove();
            $(".pathway ").remove();
            $(".main_right div:not(:last-child)").remove();
            $(".link ").remove();
            $("#footer").remove();
        }
    }


    //$("iframe").not("#commentsiframe").each(function() {$(this).remove();});
    $(".footer_about").remove();


    $(".share table tbody tr td:lt(2)").remove();

    $(".yzm").css("margin-right", "30px");
})();