巴哈姆特之查詢該使用者本看板發文

在C頁的使用者名稱後面新增「本板發文」按鈕,以快速查詢該使用者本板發文。

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         巴哈姆特之查詢該使用者本看板發文
// @description  在C頁的使用者名稱後面新增「本板發文」按鈕,以快速查詢該使用者本板發文。
// @namespace    nathan60107
// @version      1.2
// @author       nathan60107(貝果)
// @homepage     https://home.gamer.com.tw/homeindex.php?owner=nathan60107
// @match        *forum.gamer.com.tw/C*
// @icon         https://www.google.com/s2/favicons?domain=gamer.com.tw
// @run-at       document-end
// @noframes
// ==/UserScript==

(function() {
    let bsn = window.location.href.match(/.*(?<!sub)bsn=(\d+).*/)[1]
    for(let user of jQuery(".c-post__header__author")){
        let uid = jQuery(user).find(".userid")[0].innerText
        jQuery(user).append(`
<a class="floor tippy-gpbp" data-tooltipped="" data-original-title="本板發文" href="https://forum.gamer.com.tw/Bo.php?bsn=${bsn}&qt=6&q=${uid}">
    本板發文
</a>
`)
    }
})();