Greasy Fork

Greasy Fork is available in English.

精简快科技(驱动之家)新闻站

精简快科技新闻站

目前为 2020-11-19 提交的版本,查看 最新版本

// ==UserScript==
// @name         精简快科技(驱动之家)新闻站
// @description  精简快科技新闻站
// @icon         http://www.drivergenius.com//favicon.ico
// @namespace http://greasyfork.icu/users/204104
// @version      1.1
// @author       佚名
// @include      http*://*.mydrivers.com/*
// ==/UserScript==

(function () {

    //文章页精简
    var isContentPage = /.*htm$/.test(location.href) && /^http(s)?:\/\/news\.mydrivers\.com\/.*$/.test(location.href)
    if (isContentPage) {
        $(".xianguan").remove();
        $(".main_right").remove();
        $("body").html($(".main_box").html().replace('<div class="main_left" style="width:1000px;">', '<div class="main_left" style="margin:0 auto;float:none;">'))
    }

    // 首页精简
    var checkHigh = window.location.href.match(/mydrivers\.com\/$/);//检查首页
    var newsList = null;
    if (checkHigh) {
        $(".main_right").remove();
        $(".main_2").remove();
        newsList = $(".main").first().html();
    }
    if (newsList) {
        newsList = newsList.replace('class="main_left"','class="main_left" style="margin:0 auto;float:none;"');
        $("body").html(newsList);
    }
})()