Greasy Fork

来自缓存

Greasy Fork is available in English.

IT之家首页清洁

简化IT之家首页内容,只保留最新的文章列表

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         IT之家首页清洁
// @namespace    http://greasyfork.icu/zh-TW/scripts/445365
// @version      1.0.0
// @description  简化IT之家首页内容,只保留最新的文章列表
// @author       aSmecta
// @license      MIT
// @match        *://*.ithome.com/*
// @icon         https://ugmark.com/img/icons/favicon-32x32.png
// @supportURL   http://greasyfork.icu/zh-TW/scripts/445365
// @grant        GM_addStyle
// ==/UserScript==
 
(function() {
    'use strict';
 
    // Custom Style
    var css=`
    #news{
    padding-top: 20px;
    padding-bottom: 25px;
    }
     #nnews,#dt .content{
     width: 100%;
     }
     #nav, #nav .fr{
     height:auto
     }
     ul.nl{
     width:46%;
     padding-top:0;
     margin-top:0;
     }
     ul.nl li a{
     width:calc(100% - 60px);
     }
     #nnews .t-f{
     margin-bottom:20px;
     }
     #tt, .ra, #nav .fl, #news .fl,.hotkeyword, div.bl.bb, #fls.bb, #cp.bb,#side_func a, .fr .t-h, footer,div.mt.so,#top #music,#dt .fr, .newsgrade, .shareto, .related_post, .dajia{
     display:none !important;
     }
     .article-share-code, .page-last, .page-next{
      display:none;
     }
     .fr{
     float:initial;
     }
     .cnbeta-update-list, .cnbeta-article{
     width:auto;
     }
     .pmsg{
        margin:0 auto;
      }
    `
    GM_addStyle(css)
    var ads = document.querySelectorAll('.ad');
    Array.from(ads).map(function(ad){
        ad.parentNode.style.display = 'none';
    })
    var itList = document.querySelectorAll('.t-b.clearfix');
    Array.from(itList).map(function(item) {
        item.classList.add('sel')
        document.querySelector('#n-p').style.display='none';
    });

    $("#nmsg").click(function(){
        location.reload()
    })
})();