Greasy Fork

Greasy Fork is available in English.

Bilibili 翻页评论区

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

当前为 2021-05-03 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(function() {
    'use strict';

    // 拦截新版评论
    Object.defineProperty(unsafeWindow, "bbComment", { get: () => {
        window.commentAgent = unsafeWindow.commentAgent; // 修复评论时间戳
        return window.bbComment;
    }});
    async function addCss(css){
        if (!document.head) return setTimeout(() => { addCss(css)}, 100);
        let style = document.createElement("style");
        style.setAttribute("type", "text/css");
        style.appendChild(document.createTextNode(css));
        document.head.appendChild(style);
    }
    addCss(GM_getResourceText("style") + ".bb-comment .comment-header .header-page, .comment-bilibili-fold .comment-header .header-page { float: right;line-height: 36px;}"); // 补全评论样式
})();