Greasy Fork

Greasy Fork is available in English.

Bilibili 翻页评论区

恢复原来的翻页评论区,同时修复评论楼层号。

当前为 2021-11-27 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Bilibili 翻页评论区
// @namespace    MotooriKashin
// @version      0.2.7
// @description  恢复原来的翻页评论区,同时修复评论楼层号。
// @author       MotooriKashin
// @match        *://*.bilibili.com/*
// @resource     script https://cdn.jsdelivr.net/gh/MotooriKashin/Bilibili-Old/dist/comment.min.js
// @resource     style https://cdn.jsdelivr.net/gh/MotooriKashin/Bilibili-Old/CSS/comment.css
// @run-at       document-start
// @grant        GM_getResourceText
// @license      MIT License
// ==/UserScript==

(function() {
    'use strict';

    function addCss(css, id) {
        if (!css) return;
        if (!document.head) return setTimeout(() => { this.addCss(css, id) });
        let style = document.createElement("style");
        if (id) {
            if (document.querySelector("#" + id)) return;
            style.setAttribute("id", id);
        }
        style.setAttribute("type", "text/css");
        style.appendChild(document.createTextNode(css));
        if (document.head) {
            document.head.appendChild(style);
            let link = document.createElement("link");
            link.setAttribute("type", "text/css");
            link.setAttribute("rel","stylesheet");
            link.setAttribute("href","//static.hdslb.com/phoenix/dist/css/comment.min.css");
            document.head.appendChild(link);
        }
    }
    function cover() {
        delete unsafeWindow.bbComment;
        new Function(GM_getResourceText("script"))();
        addCss(GM_getResourceText("style"));
        addCss(`.bb-comment .user .stick, .comment-bilibili-fold .stick {
    border: 1px solid #ff81aa;
    min-width: 30px;
    display: inline-block;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
    color: #ff81aa;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
    font-weight: 400;
    padding: 0;
}`)
    }
    if (unsafeWindow.bbComment) cover();
    else {
        Object.defineProperty(unsafeWindow, "bbComment", {
            set: () => { cover() },
            get: () => undefined,
            configurable: true
        })
    }
})();