Greasy Fork

Greasy Fork is available in English.

MangaDex HideFollows

On the followed manga page, hides chapters that are marked as read

当前为 2019-09-01 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        MangaDex HideFollows
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  On the followed manga page, hides chapters that are marked as read
// @author       platypusq
// @match        https://mangadex.org/follows*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    var allRows;
    var htmlName
    var lastValue='placeholder';

    allRows=document.querySelectorAll(".chapter-container .row");

    // Add the class 'd-none' to rows that are marked as read. This class prevents them from diplaying.
    allRows.forEach(function(e,i){
        var unreadRows=e.querySelector('.chapter_mark_unread_button');
        if(unreadRows != null && allRows !=null){
            e.classList.add("d-none");
            e.classList.add("blank-marker");
        }
    });

    //Hide and unhide names to maintain the layout of the page. Bascially, make it so if multiple
    //chapters of the same manga are in a row, only the first one displays the name
    allRows.forEach(function(e,i){
        var nameArea=e.querySelector('.col-md-3');
        if(nameArea != null && i !=0){
            if(nameArea.querySelector('a') != null && nameArea.childNodes.length===3){
                htmlName=nameArea.innerHTML;
            }
            else{
                nameArea.innerHTML=htmlName;
            }
        }
    });

    allRows.forEach(function(e,i){
        var theRow=e.querySelector('.col-md-3');
        if(theRow != null && i !=0 && e.getElementsByClassName("blank-marker").length==0){
            var thisValue=theRow.innerHTML;
            if(thisValue===lastValue){
                theRow.innerHTML='';
            }
            else{lastValue=thisValue}
        }
    });
})();