Greasy Fork

Greasy Fork is available in English.

巴哈姆特之C頁文章顯示子板

可以在C頁文章頁面確認子板,無須回到B頁文章列表查看。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         巴哈姆特之C頁文章顯示子板
// @description  可以在C頁文章頁面確認子板,無須回到B頁文章列表查看。
// @namespace    nathan60107
// @version      2.5
// @author       nathan60107(貝果)
// @contributor  moontai0724(我是月太 づ(・ω・)づ)
// @homepage     https://home.gamer.com.tw/homeindex.php?owner=nathan60107
// @include      https://forum.gamer.com.tw/C*
// @run-at       document-end
// @noframes
// ==/UserScript==

(function(){
    jQuery('head').append('<style type="text/css"> .tag-category_item { display:none!important; } </style>>')

    let bsn = window.location.href.match(/.*[^b]bsn=(\d+).*/)[1]
    let subbsn = jQuery(".more .tippy-option-menu").data("tippy")["subbsn"]

    function expand_title(target, subbsn_name){
        jQuery(target).text(`《${subbsn_name}》${jQuery(target).text()}`)
    }

    function add_subbsn(data){
        let subbsn_name = jQuery(data).find(`.b-tags__item a[href$="${bsn}&subbsn=${subbsn}"]`).text()
        expand_title(".c-post__header__title", subbsn_name)
        expand_title(".c-disable__title", subbsn_name)
        expand_title(".title", subbsn_name)
    }

    jQuery.get({
        url: `https://forum.gamer.com.tw/B.php?bsn=${bsn}`,
        success: add_subbsn,
    })
})();