Greasy Fork

Greasy Fork is available in English.

Qidian Get Chapter Date

Fetches and displays the chapter dates for Qidian books

当前为 2021-04-23 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Qidian Get Chapter Date
// @namespace    http://greasyfork.icu/en/users/689482-quin15
// @version      1.1.0
// @description  Fetches and displays the chapter dates for Qidian books
// @author       Quin15
// @match        https://book.qidian.com/info/*
// @icon         https://www.google.com/s2/favicons?domain=qidian.com
// @grant        none
// ==/UserScript==

var checkElems = function() {if (document.querySelector('.volume .cf li')) {injectDates()} else {setTimeout(checkElems, 100);}};
checkElems();

var injectDates = function() {
    var chaplist = document.querySelectorAll('.volume .cf li')
    for (var i = 0; i < chaplist.length; i++) {
        var date = chaplist[i].firstElementChild.title.replace('首发时间:', '').substr(0, 10);
        var dateElem = document.createElement('div');
        dateElem.style = "width: 100%; color: #888; font-size: 12px; line-height: 0;";
        dateElem.innerText = date;
        chaplist[i].style.height = "50px";
        chaplist[i].firstElementChild.style.float = "none"
        chaplist[i].appendChild(dateElem)
    };
};