Bilibili Show Chapter Date

Fetches and displays the chapter dates for Bilibili manhua

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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Bilibili Show Chapter Date
// @namespace    https://greasyfork.org/en/users/689482-quin15
// @version      0.1.2
// @description  Fetches and displays the chapter dates for Bilibili manhua
// @author       You
// @match        https://manga.bilibili.com/detail*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

setTimeout(function(){
    fetch("https://manga.bilibili.com/twirp/comic.v1.Comic/ComicDetail?device=pc&platform=web", {
        "headers": {
            "accept": "application/json, text/plain, */*",
            "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
            "content-type": "application/json;charset=UTF-8"
        },
        "referrer": "https://manga.bilibili.com",
        "referrerPolicy": "strict-origin-when-cross-origin",
        "body": "{\"comic_id\":" + document.location.href.split('/').reverse()[0].split('?')[0].replace('mc', '') + "}",
        "method": "POST"
    }).then((response) => {
        response.json().then((data) => {
            var elemDates = data.data.ep_list.reverse();
            //console.log(elemDates);
            var episodes = document.querySelectorAll('.list-data button');
            for (var i = 0; i < episodes.length; i++) {
                var dateElem = document.createElement('div');
                dateElem.style = "width: 100%; color: #888; font-size: 12px";
                dateElem.innerText = elemDates[i].pub_time.slice(0,10);
                episodes[i].style.height = "";
                episodes[i].style.flexFlow = "wrap";
                episodes[i].appendChild(dateElem);
            };
        });
    });
}, 400);